summaryrefslogtreecommitdiffstats
path: root/core/modules/pam/data/opt/openslx/scripts/pam_script_ses_open
blob: 0050758c7b02839aa78fca828d47826298c7080d (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
#!/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"

# just exit for greeter sessions
[ "x${PAM_SERVICE%greeter}" != "x${PAM_SERVICE}" ] && exit 0

# 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