summaryrefslogtreecommitdiffstats
path: root/core/modules/pam/data/opt/openslx/scripts/pam_script_ses_close
blob: 80b496d62fa0d5f49c26168895a6f77bc0389ab1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/ash

# # # # # # # # # # # # # # # # # # #
# Legacy script - present only for
# backwards compat with old config.tgz
# modules. Newer approach lies in
# /opt/openslx/pam
# # # # # # # # # # # # # # # # # # #

# Needed as pam_script clears PATH
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin"

# can only work if script is run as root
[ "x$(whoami)" = "xroot" ] || exit 0

[ "x${PAM_SERVICE%greeter}" != "x${PAM_SERVICE}" ] && exit 0

# source hooks if there are any
if [ -d "/opt/openslx/scripts/pam_script_ses_close.d" ]; then
	for HOOK in $(ls "/opt/openslx/scripts/pam_script_ses_close.d"); do
		# failure is non-critical
		. "/opt/openslx/scripts/pam_script_ses_close.d/$HOOK" || slxlog "pam-sesclose-hooks" "Could not source '$HOOK'."
	done
fi

exit 0