Page 1 of 1

Bash script to change the run state and to check it at every boot

Posted: Sat Nov 04, 2017 12:36 pm
by Mentor.37
Here a simple bash script to change the run state.

Use case example:
We have three state, Day, Night and Armed. The Day state is from 8 to 24. The Night state is from 24 to 8.
We can set via cron to switch from Day to Night and vice-versa, except for the case if the current state is Armed.
We can set via cron to check at every boot if the current state is correct comparing the current hour and in case the state is wrong we can set the right state.

Re: Bash script to change the run state and to check it at every boot

Posted: Wed May 02, 2018 3:02 pm
by Mentor.37
If can interest, here a more update script that can also arm zoneminder if a bluetooth device isn't more detected.