diff options
author | Simon Rettberg | 2016-10-31 16:44:48 +0100 |
---|---|---|
committer | Simon Rettberg | 2016-10-31 16:44:48 +0100 |
commit | f5fe048ba2069514b3e395869ff7b30c3f7bb013 (patch) | |
tree | 7e67f555f7d99ad5d65f1b067faac567f462552b | |
parent | ....aaaand it's done! (diff) | |
download | tm-scripts-f5fe048ba2069514b3e395869ff7b30c3f7bb013.tar.gz tm-scripts-f5fe048ba2069514b3e395869ff7b30c3f7bb013.tar.xz tm-scripts-f5fe048ba2069514b3e395869ff7b30c3f7bb013.zip |
[pvs2] Restart pvsmgr on exit-code != 0
-rwxr-xr-x | remote/modules/pvs2/data/opt/openslx/scripts/setup-pvsmgr | 16 |
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 |