summaryrefslogtreecommitdiffstats
path: root/remote/modules/pvs2/data/opt/openslx/bin/pvsstartup
blob: 16a017084a40dd30b36ff46e682c4e8a70e90572 (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

timediff=5
counter=0

. /opt/openslx/config
EXAM=
if [ -n "$SLX_EXAM" ]; then
	EXAM="--exam-mode"
fi

while [ $timediff -gt 3 ]; do
	start="$(date +%s)"
	pvsclient $EXAM "$@"
	ret=$?
	end="$(date +%s)"
	/opt/openslx/pvs2/kb-unlock.sh
	[ "$ret" == "0" ] && break
	timediff=$(( end - start ))
	counter=$(( counter + 1 ))
	[ $counter -gt 8 ] && break
done

exit $ret