From e6d8678a3272802015d378e3a28c11067fc7cfdc Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 12 Feb 2015 15:04:36 +0100 Subject: [idleaction] Check if timeouts are > 0 --- .../idleaction/data/opt/openslx/scripts/idleaction-cron_script | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'remote/modules') diff --git a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script index f034553c..ad74def0 100755 --- a/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script +++ b/remote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script @@ -11,7 +11,7 @@ NOW=$(date +%s) # # 1) Check for idle timeout # -if [ -n "${SLX_LOGOUT_TIMEOUT}" ]; then +if [ -n "${SLX_LOGOUT_TIMEOUT}" ] && [ "${SLX_LOGOUT_TIMEOUT}" -gt 0 ]; then # Logout timeout is set, see which users we should kick IS_IDLE=yes # get all sessions @@ -84,7 +84,7 @@ fi # # 2) Check for no-session-shutdown timeout # -if [ -n "$SLX_SHUTDOWN_TIMEOUT" ] && [ -e "$IDLEHINT" ]; then +if [ -n "${SLX_SHUTDOWN_TIMEOUT}" ] && [ "${SLX_SHUTDOWN_TIMEOUT}" -gt 0 ] && [ -e "$IDLEHINT" ]; then IDLE=$(cat "$IDLEHINT") [ "$IDLE" -gt "$NOW" ] && IDLE="$NOW" IDLE=$(( $NOW - $IDLE )) -- cgit v1.2.3-55-g7522