You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
Here is my small contribution to the script: a way to shedule to turn off the plug (hardcoded to 30 minutes). If called another time, the last call cancel any previous schedule and reset the schedule to 30 min.
I trigger that command when a printer finish its job, in order to turn off that printer after a while, if no other print job is launched (in which case, the timeout is reset to 30 min on each print job).
cmd_schedule_switch_off(){
# Cancel any scheduled turn-off
# Browse all AT tasks and, for those containing the script name ($0), ask AT to stop them
for j in $(atq | cut -f 1);
do
if at -c $j | grep -q $0; then
echo Stop scheduled turn-off task $j
at -r $j
fi
done
# Schedule in 30 minutes to turn off the plug
echo "$0 $ip $port off" | at now+30minute
}
The text was updated successfully, but these errors were encountered:
OhSoGood
changed the title
New schedule_off command (code included)
hs100: new schedule_off command (code included)
Jun 27, 2021
Hi
Here is my small contribution to the script: a way to shedule to turn off the plug (hardcoded to 30 minutes). If called another time, the last call cancel any previous schedule and reset the schedule to 30 min.
I trigger that command when a printer finish its job, in order to turn off that printer after a while, if no other print job is launched (in which case, the timeout is reset to 30 min on each print job).
The text was updated successfully, but these errors were encountered: