18
How Schedule Script Works?
A schedule script defines a serial of ON/OFF states and specify the duration of each state. At the end
of each state, there should be a scheduled shutdown (for ON state) or scheduled startup (for OFF
state). All states in the schedule script will be executed in sequence and repeatedly, until the END
time is reached.
Every time your Raspberry Pi wakes up, it has a chance to run the runScript.sh file, which loads the
schedule script (“schedule.wpi” file). If the current time doesn’t reach the END time defined by the
schedule script, the next shutdown and next startup will be scheduled automatically. When your
Raspberry Pi is wakened at scheduled startup time, it will repeat this process and schedule the next
shutdown and startup. Although a schedule script only defines a few ON/OFF states, they could
become many ON/OFF states in reality.
Start
File
“schedule.wpi
” exists?
Y
N
Find current and next
state in the loop
Reached
END time?
Schedule next shutdown
and startup
Y
End
N