diff options
author | Soispha <soispha@vhack.eu> | 2023-12-29 21:48:27 +0100 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2023-12-29 21:48:27 +0100 |
commit | 2292808d0a88fc551d7671d8f66bc236a8d1a99c (patch) | |
tree | a6ec35773af541544e32b8e0bdee10ebeaf1793f | |
parent | chore(version): v1.22.0 (diff) | |
download | nixos-config-2292808d0a88fc551d7671d8f66bc236a8d1a99c.tar.gz nixos-config-2292808d0a88fc551d7671d8f66bc236a8d1a99c.zip |
fix(hm/pkgs/hibernate): Only unset task context + active if existing
-rwxr-xr-x | hm/soispha/pkgs/scripts/wrappers/hibernate | 5 |
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 "$@" |