From 2292808d0a88fc551d7671d8f66bc236a8d1a99c Mon Sep 17 00:00:00 2001 From: Soispha Date: Fri, 29 Dec 2023 21:48:27 +0100 Subject: fix(hm/pkgs/hibernate): Only unset task context + active if existing --- hm/soispha/pkgs/scripts/wrappers/hibernate | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hm') 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 "$@" -- cgit 1.4.1