bug fixing

This commit is contained in:
Sayantan Santra 2022-07-27 23:13:56 -05:00
parent a8258d2f89
commit e909ec779a

View file

@ -30,6 +30,9 @@ else
exit exit
fi fi
# sometimes we need to wait a minute so that the next schedule is set up properly (or sunwait reports day/night in a misleading way)
[ "$2" == "wait" ] && echo "Waiting 60 seconds..." && sleep 60
# get sun status # get sun status
sun_status=$(sunwait poll $latitude $longitude) sun_status=$(sunwait poll $latitude $longitude)
[ $sun_status == "DAY" ] && target=$high || target=$low [ $sun_status == "DAY" ] && target=$high || target=$low
@ -54,9 +57,6 @@ if [ "$1" == "scheduler" ]; then
[ "$(at -c $item | sed 'x;$!d')" == "$scriptdir/brightness-by-daylight.sh scheduler wait" ] && flag=false [ "$(at -c $item | sed 'x;$!d')" == "$scriptdir/brightness-by-daylight.sh scheduler wait" ] && flag=false
done done
# sometimes we need to wait a minute so that the next schedule is set up properly (or sunwait reports day/night in a misleading way)
[ "$2" == "wait" ] && sleep 60
# actually create the schedule # actually create the schedule
$flag && at -m $time_next <<< "$scriptdir/brightness-by-daylight.sh scheduler wait" $flag && at -m $time_next <<< "$scriptdir/brightness-by-daylight.sh scheduler wait"
fi fi