diff options
author | Simon Rettberg | 2018-04-25 14:32:50 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-04-25 14:32:50 +0200 |
commit | 8cb0c4db5f55d60e6f0b7e75ebdb4f56cf274476 (patch) | |
tree | 1ddfb4c4cfdf9bc1f0b324ed88205561d81b3d87 | |
parent | [pam-bwidm] Set proper Content-Type in request (diff) | |
download | mltk-8cb0c4db5f55d60e6f0b7e75ebdb4f56cf274476.tar.gz mltk-8cb0c4db5f55d60e6f0b7e75ebdb4f56cf274476.tar.xz mltk-8cb0c4db5f55d60e6f0b7e75ebdb4f56cf274476.zip |
[idleaction] Add kexec-reboot support
-rwxr-xr-x | core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action | 6 | ||||
-rwxr-xr-x | core/modules/kexec-reboot/data/opt/openslx/bin/kexec-reboot | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action index 57ffcc04..7a1b2afd 100755 --- a/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action +++ b/core/modules/idleaction/data/opt/openslx/scripts/idleaction-scheduled_action @@ -12,7 +12,7 @@ if [ "$1" = "--detach" ]; then fi if [ $# -lt 1 ]; then - echo "$0 [--detach] <reboot|poweroff> [delay_minutes]" >&2 + echo "$0 [--detach] <reboot|poweroff|kexec-reboot> [delay_minutes]" >&2 exit 2 fi @@ -49,7 +49,7 @@ if [ -n "$TS" ]; then fi fi -if [ "$MODE" != "reboot" ] && [ "$MODE" != "poweroff" ]; then +if [ "$MODE" != "reboot" ] && [ "$MODE" != "poweroff" ] && [ "$MODE" != "kexec-reboot" ]; then slxlog --echo "idleaction-failed-call" "Invalid call to idleaction-scheduled_action. Mode '$MODE' unknown." >&2 exit 3 fi @@ -79,7 +79,7 @@ runaction () { [ "$NUM" = "0" ] && break if [ "$MINUTES" != "X" ]; then USERS=0 - if [ "$MODE" = "reboot" ]; then + if [ "${MODE#*-}" = "reboot" ]; then MESSAGE="Das System wird in $MINUTES Minute(n) neugestartet, bitte beenden Sie Ihre Sitzung. The system will reboot in $MINUTES minute(s). Please save your work and end the session." else diff --git a/core/modules/kexec-reboot/data/opt/openslx/bin/kexec-reboot b/core/modules/kexec-reboot/data/opt/openslx/bin/kexec-reboot new file mode 100755 index 00000000..60197f50 --- /dev/null +++ b/core/modules/kexec-reboot/data/opt/openslx/bin/kexec-reboot @@ -0,0 +1,4 @@ +#!/bin/ash + +exec systemctl start kexec.target + |