summaryrefslogtreecommitdiffstats
path: root/remote/modules/pam/data/opt/openslx/scripts
diff options
context:
space:
mode:
authorDirk2013-12-13 18:13:04 +0100
committerDirk2013-12-13 18:13:04 +0100
commitc89c15556e55b43fa50ed9d76b2ffd7ed7bc2c1c (patch)
treed06acc0585d5b049ca9f6c7de09b282815160520 /remote/modules/pam/data/opt/openslx/scripts
parentStatic configuration file for udhcpd sitting on new nat1 bridge interface. (diff)
parentadd linkstate check; add dmesg to stage32 (for debug) (diff)
downloadtm-scripts-c89c15556e55b43fa50ed9d76b2ffd7ed7bc2c1c.tar.gz
tm-scripts-c89c15556e55b43fa50ed9d76b2ffd7ed7bc2c1c.tar.xz
tm-scripts-c89c15556e55b43fa50ed9d76b2ffd7ed7bc2c1c.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
...
Diffstat (limited to 'remote/modules/pam/data/opt/openslx/scripts')
-rwxr-xr-xremote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close4
1 files changed, 4 insertions, 0 deletions
diff --git a/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close b/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close
index 535cd0d6..198d2efe 100755
--- a/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close
+++ b/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close
@@ -13,6 +13,10 @@ slxlog "session-close" "$PAM_USER logged out on $PAM_TTY"
OPENSESSION=$(loginctl show-user "$PAM_USER" | grep "Sessions=" | cut -c 10-)
SESSIONCOUNT=$(echo "$OPENSESSION" | wc -w)
+# When using su/sudo there is no session created, so count up by one
+if [ "x$PAM_SERVICE" = "xsu" -o "x$PAM_SERVICE" = "xsudo" ]; then
+ SESSIONCOUNT=$(( $SESSIONCOUNT + 1 ))
+fi
if [ "$SESSIONCOUNT" = "1" ]; then
# last sessions, close all ghost user processes