summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2015-02-12 15:04:36 +0100
committerSimon Rettberg2015-02-12 15:04:36 +0100
commite6d8678a3272802015d378e3a28c11067fc7cfdc (patch)
tree43cb276ff70f30bf0d5b9c026f7eba5ef819b4a5
parent[nscd] fix bad nscd template (diff)
downloadtm-scripts-e6d8678a3272802015d378e3a28c11067fc7cfdc.tar.gz
tm-scripts-e6d8678a3272802015d378e3a28c11067fc7cfdc.tar.xz
tm-scripts-e6d8678a3272802015d378e3a28c11067fc7cfdc.zip
[idleaction] Check if timeouts are > 0
-rwxr-xr-xremote/modules/idleaction/data/opt/openslx/scripts/idleaction-cron_script4
1 files changed, 2 insertions, 2 deletions
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 ))