IF shutting down due to low voltage threshold (checks to be made in beforeShutdown.sh using something like tail -n 10 wittypi.log | grep “shutdown message seen in log” ) THEN run WittyPi schedule generation (before the delay) to make sure systems turns ON as per schedule . But this is a rare issue and maybe concerned with a damaged witty pi so I will let you all decide the best course of action for this.
IF (current_time > end_time in schedule.wpi ) OR (ON due to 5V / USB connected message in wittypi.log) OR (no schedule.wpi file present) THEN run Witty Pi schedule generation in afterStartup.sh
As a temporary solution, the wpi_script_generator_ags.py will run in the crontab every day at midnight and 5 minutes and in the the afterStartup.sh file.
Possible solution propose by @abhimandela:
IF shutting down due to low voltage threshold (checks to be made in beforeShutdown.sh using something like tail -n 10 wittypi.log | grep “shutdown message seen in log” ) THEN run WittyPi schedule generation (before the delay) to make sure systems turns ON as per schedule . But this is a rare issue and maybe concerned with a damaged witty pi so I will let you all decide the best course of action for this.
IF (current_time > end_time in schedule.wpi ) OR (ON due to 5V / USB connected message in wittypi.log) OR (no schedule.wpi file present) THEN run Witty Pi schedule generation in afterStartup.sh