diff options
| author | Simon Rettberg | 2015-12-04 13:04:11 +0100 |
|---|---|---|
| committer | Simon Rettberg | 2015-12-04 13:04:11 +0100 |
| commit | f644d1232477e1fe8da3187eee6e09ef7bfcc4f3 (patch) | |
| tree | cfbe8fbcb39cbef698c0c38e3956f683a1356c71 | |
| parent | Update .gitignore (diff) | |
| download | tm-scripts-f644d1232477e1fe8da3187eee6e09ef7bfcc4f3.tar.gz tm-scripts-f644d1232477e1fe8da3187eee6e09ef7bfcc4f3.tar.xz tm-scripts-f644d1232477e1fe8da3187eee6e09ef7bfcc4f3.zip | |
[pam] Add .d directory support to pam_script_ses_open/close
| -rwxr-xr-x | remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_close | 8 | ||||
| -rwxr-xr-x | remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_open | 8 |
2 files changed, 16 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 6b8cb3b2..c80b50bb 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 @@ -75,5 +75,13 @@ if [ "$SESSIONCOUNT" -le "1" ]; then fi +# source the stuff in pam_script_ses_close.d, if it exists +if [ -d "/opt/openslx/scripts/pam_script_ses_close.d" ]; then + for HOOK in $(ls "/opt/openslx/scripts/pam_script_ses_close.d"); do + # source it, in case of failure do nothing since these scripts are non-critical + . "/opt/openslx/scripts/pam_script_ses_close.d/$HOOK" || slxlog "pam-source-hooks" "Could not source '$HOOK'." + done +fi + exit 0 diff --git a/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_open b/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_open index c64a2ed7..8ab34708 100755 --- a/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_open +++ b/remote/modules/pam/data/opt/openslx/scripts/pam_script_ses_open @@ -13,5 +13,13 @@ if [ "x$PAM_SERVICE" != "xsu" -a "x$PAM_SERVICE" != "xsudo" ]; then fi fi +# source the stuff in pam_script_ses_open.d, if it exists +if [ -d "/opt/openslx/scripts/pam_script_ses_open.d" ]; then + for HOOK in $(ls "/opt/openslx/scripts/pam_script_ses_open.d"); do + # source it, in case of failure do nothing since these scripts are non-critical + . "/opt/openslx/scripts/pam_script_ses_open.d/$HOOK" || slxlog "pam-source-hooks" "Could not source '$HOOK'." + done +fi + exit 0 |
