aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-08 16:18:08 -0500
committerCraig Jennings <c@cjennings.net>2026-07-08 16:18:08 -0500
commitd88fb3aadc04bd2db84da3a500e40a04be20df80 (patch)
tree48267d3ccfa066016ca0f58ca7246489697c86ad /scripts
parentde391e554fad2ca21e44c772a1ed5694b13e82df (diff)
downloadarchsetup-d88fb3aadc04bd2db84da3a500e40a04be20df80.tar.gz
archsetup-d88fb3aadc04bd2db84da3a500e40a04be20df80.zip
fix(guard): consume the override sentinel as it's honored
One touch buys exactly one transaction. The maintenance console's forced live update sets the sentinel and clears it afterward, but a caller that dies mid-update would leave the file behind and keep the guard disarmed until reboot. The hook now deletes the sentinel at the moment it honors it, so a missed cleanup costs nothing. The env override is unchanged, and the caller's clear step stays as the belt-and-suspenders for transactions the hook never fires on.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/hypr-live-update-guard11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/hypr-live-update-guard b/scripts/hypr-live-update-guard
index 614414b..e78200d 100755
--- a/scripts/hypr-live-update-guard
+++ b/scripts/hypr-live-update-guard
@@ -42,8 +42,15 @@ set -u
sentinel="${HYPR_GUARD_SENTINEL:-/run/archsetup-allow-live-gpu-update}"
-# Explicit override: the user knows what they're doing.
-if [ "${HYPR_ALLOW_LIVE_UPDATE:-0}" = "1" ] || [ -e "$sentinel" ]; then
+# Explicit override: the user knows what they're doing. The sentinel is
+# consumed as it's honored — one touch buys exactly one transaction, so a
+# leftover from a crashed caller can't keep the guard disarmed until
+# reboot.
+if [ "${HYPR_ALLOW_LIVE_UPDATE:-0}" = "1" ]; then
+ exit 0
+fi
+if [ -e "$sentinel" ]; then
+ rm -f "$sentinel" 2>/dev/null || true
exit 0
fi