diff --git a/sunset-alarm b/sunset-alarm index 617cc31..93c0066 100755 --- a/sunset-alarm +++ b/sunset-alarm @@ -229,10 +229,11 @@ while true; do echo "Alert time has been reached, show message." show_alert NOTIFIED="true" - - echo "Alert has been dismissed, sleeping for 5 minutes." - sleep 290 - echo "Waking back up from notification dismissal." + echo "Alert has been dismissed." + if [[ -n "$PERSIST" ]]; then + echo "Sleeping for 5 minutes before next notification." + sleep 300 + fi elif [[ "$SUNSET_EPOCH" == 0 ]]; then echo "ERROR: Sunset time has not been calculated yet, cannot alert." >&2 elif [[ -n "$NOTIFIED" && -z "$PERSIST" ]]; then @@ -248,6 +249,4 @@ while true; do LAST_DATE="" NOTIFIED="" fi - - sleep 10 done