summaryrefslogtreecommitdiffstats
path: root/remote/modules/pvs2/data/opt/openslx/bin/pvsstartup
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules/pvs2/data/opt/openslx/bin/pvsstartup')
-rwxr-xr-xremote/modules/pvs2/data/opt/openslx/bin/pvsstartup13
1 files changed, 12 insertions, 1 deletions
diff --git a/remote/modules/pvs2/data/opt/openslx/bin/pvsstartup b/remote/modules/pvs2/data/opt/openslx/bin/pvsstartup
index b77dcd51..dc7bd48a 100755
--- a/remote/modules/pvs2/data/opt/openslx/bin/pvsstartup
+++ b/remote/modules/pvs2/data/opt/openslx/bin/pvsstartup
@@ -1,7 +1,15 @@
#!/bin/ash
-# TODO UNTESTED!
timediff=5
+counter=0
+
+. /opt/openslx/config
+if [ -n "$SLX_PVS_CONFIG_URL" ]; then
+ [ -z "$UID" ] && UID="$(id -u)"
+ [ -z "$HOME" ] && HOME="$(getent passwd "$UID" | head -n 1 | awk -F ':' '{print $6}')"
+ wget -O "$HOME/.config/openslx/pvs2/pvs2.ini" "$SLX_PVS_CONFIG_URL"
+fi
+
while [ $timediff -gt 3 ]; do
start="$(date +%s)"
pvsclient "$@"
@@ -10,6 +18,9 @@ while [ $timediff -gt 3 ]; do
/opt/openslx/pvs2/kb-unlock.sh
[ "$ret" == "0" ] && break
timediff=$(( end - start ))
+ counter=$(( counter + 1 ))
+ [ $counter -gt 8 ] && break
done
+exit $ret