summaryrefslogblamecommitdiffstats
path: root/core/modules/vmchooser2/data/opt/openslx/vmchooser/sessionstart
blob: 0d75a4cfd63a3ff22ffb85ac5cfb540f63be3783 (plain) (tree)
1
2
3
4
5
6
7
8

          

                                                            
                                                          
                             
       
 















                                                                                                        
#!/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 two seconds, so we won't execute
# all the sessionstart hooks.
sleep 2

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