From 7bbc58c3c61ea4d2fa487543fff9d3f2dbf873bd Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 30 Sep 2022 15:24:08 +0200 Subject: [idleaction] Make auto-logout = shutdown when auto-login is enabled --- .../idleaction/data/opt/openslx/scripts/idle-daemon-launcher | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/modules') diff --git a/core/modules/idleaction/data/opt/openslx/scripts/idle-daemon-launcher b/core/modules/idleaction/data/opt/openslx/scripts/idle-daemon-launcher index 98168436..640ef9fb 100755 --- a/core/modules/idleaction/data/opt/openslx/scripts/idle-daemon-launcher +++ b/core/modules/idleaction/data/opt/openslx/scripts/idle-daemon-launcher @@ -6,6 +6,17 @@ CMD= [ -n "$SLX_SHUTDOWN_TIMEOUT" ] && CMD="$CMD --poweroff-timeout $SLX_SHUTDOWN_TIMEOUT" +if [ -n "${SLX_AUTOLOGIN%OFF}" ]; then + # Autologin is enabled - special case logout timeout, which should turn into + # a shutdown. + if [ -n "$SLX_SHUTDOWN_TIMEOUT" ] && [ -n "$SLX_LOGOUT_TIMEOUT" ] && [ "$SLX_SHUTDOWN_TIMEOUT" -gt "$SLX_LOGOUT_TIMEOUT" ]; then + SLX_LOGOUT_TIMEOUT="$SLX_SHUTDOWN_TIMEOUT" + fi + if [ -n "$SLX_LOGOUT_TIMEOUT" ]; then + CMD="$CMD --logout-is-shutdown" + fi +fi + if [ -z "${SLX_EXAM}" ]; then # Exam mode inactive [ -n "$SLX_LOGOUT_TIMEOUT" ] && CMD="$CMD --logout-timeout $SLX_LOGOUT_TIMEOUT" -- cgit v1.2.3-55-g7522