mirror of
https://github.com/SinTan1729/random.git
synced 2024-12-26 21:18:36 -06:00
bug fixing
This commit is contained in:
parent
a8258d2f89
commit
e909ec779a
1 changed files with 3 additions and 3 deletions
|
@ -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
|
Loading…
Reference in a new issue