summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2016-10-31 16:44:48 +0100
committerSimon Rettberg2016-10-31 16:44:48 +0100
commitf5fe048ba2069514b3e395869ff7b30c3f7bb013 (patch)
tree7e67f555f7d99ad5d65f1b067faac567f462552b
parent....aaaand it's done! (diff)
downloadtm-scripts-f5fe048ba2069514b3e395869ff7b30c3f7bb013.tar.gz
tm-scripts-f5fe048ba2069514b3e395869ff7b30c3f7bb013.tar.xz
tm-scripts-f5fe048ba2069514b3e395869ff7b30c3f7bb013.zip
[pvs2] Restart pvsmgr on exit-code != 0
-rwxr-xr-xremote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr16
1 files changed, 15 insertions, 1 deletions
diff --git a/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr b/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr
index aaaf85d2..5531518a 100755
--- a/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr
+++ b/remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr
@@ -12,5 +12,19 @@ fi
openbox &
-exec /opt/openslx/bin/pvsmgr "$CONF" "$@"
+timediff=5
+counter=0
+
+while [ $timediff -gt 3 ]; do
+ start="$(date +%s)"
+ /opt/openslx/bin/pvsmgr "$CONF" "$@"
+ ret=$?
+ [ "$ret" == "0" ] && break
+ end="$(date +%s)"
+ timediff=$(( end - start ))
+ counter=$(( counter + 1 ))
+ [ $counter -gt 8 ] && break
+done
+
+exit $ret