diff --git a/update-notify b/update-notify index 9757319..842d93e 100755 --- a/update-notify +++ b/update-notify @@ -31,8 +31,7 @@ notify_once() { if [[ -f $file && $(<"$file") == "$body" ]]; then return 0 fi - printf '%s' "$body" > "$file" - notify-send "$title" "$body" + notify-send "$title" "$body" && printf '%s' "$body" > "$file" } # Forget a key so the next occurrence notifies again. @@ -75,7 +74,9 @@ latest_version() { checkupdates_out=$(checkupdates 2>/dev/null) checkupdates_rc=$? if (( checkupdates_rc == 1 )); then + # Bail out without touching the state, so the next good run doesn't re-notify echo "checkupdates failed (network or sync problem?)" >&2 + exit 1 fi arch_list=()