sxmo_timer.sh: finish as soon as it get killed

Without this, the script will wait the full second before handling the
kill signal.
This commit is contained in:
Willow Barraco
2024-03-22 09:07:55 +01:00
parent 636053e4f1
commit 582c9b1b7b

View File

@@ -37,7 +37,8 @@ timerrun() {
DATE1="$(($(date +%s) + TIME))"; DATE1="$(($(date +%s) + TIME))";
while [ "$DATE1" -gt "$(date +%s)" ]; do while [ "$DATE1" -gt "$(date +%s)" ]; do
printf "%s\r" "$(date -u --date @$((DATE1 - $(date +%s))) +%H:%M:%S)"; printf "%s\r" "$(date -u --date @$((DATE1 - $(date +%s))) +%H:%M:%S)";
sxmo_aligned_sleep 1 sxmo_aligned_sleep 1 &
wait $!
done done
echo "Done with $*" echo "Done with $*"