summaryrefslogtreecommitdiffstats
path: root/core/modules/vmchooser2/data/opt/openslx/vmchooser/sessionstart
blob: 215077e301a4ee0871c08f9ad1837b607803d3e9 (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
#!/bin/ash

# Give it some time, in case starting the session fails.
# In that case, vmchooser will send us a SIGTERM, which will
# hopefully happen within one second, so we wont't execute
# all the sessionstart hooks.
sleep 1

SOURCEPATH="/opt/openslx/vmchooser/sessionstart.d"

if [ -d "$SOURCEPATH" ]; then
	for file in $SOURCEPATH/*; do
		"$file"
		RET=$?
		if [ "$RET" != 0 ]; then
			param="$file"
			[ "$(head -n 1 "$file" | cut -b 1)" != "#" ] && param=
			slxlog "vmchooser-sessionstart" "$file returned $RET at session start!" "$param"
		fi
	done
fi

exit 0