aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 "$@"