about summary refs log tree commit diff stats
path: root/hm
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-12-29 21:48:27 +0100
committerSoispha <soispha@vhack.eu>2023-12-29 21:48:27 +0100
commit2292808d0a88fc551d7671d8f66bc236a8d1a99c (patch)
treea6ec35773af541544e32b8e0bdee10ebeaf1793f /hm
parentchore(version): v1.22.0 (diff)
downloadnixos-config-2292808d0a88fc551d7671d8f66bc236a8d1a99c.tar.gz
nixos-config-2292808d0a88fc551d7671d8f66bc236a8d1a99c.zip
fix(hm/pkgs/hibernate): Only unset task context + active if existing
Diffstat (limited to '')
-rwxr-xr-xhm/soispha/pkgs/scripts/wrappers/hibernate5
1 files changed, 3 insertions, 2 deletions
diff --git a/hm/soispha/pkgs/scripts/wrappers/hibernate b/hm/soispha/pkgs/scripts/wrappers/hibernate
index e239cacd..4788117e 100755
--- a/hm/soispha/pkgs/scripts/wrappers/hibernate
+++ b/hm/soispha/pkgs/scripts/wrappers/hibernate
@@ -3,11 +3,12 @@
 # shellcheck source=/dev/null
 SHELL_LIBRARY_VERSION="1.10.0" . %SHELL_LIBRARY_PATH
 
-task context none
+context="$(task _get rc.context)";
+[ "$context" ] && task context none
 
 # We have ensured that only one task is active
 active="$(task +ACTIVE _ids)";
-task stop "$active"
+[ "$active" ] && task stop "$active"
 
 systemctl hibernate "$@"