From 794171e7e457d90e4dc002b55862af4102de2309 Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Sat, 9 Jul 2016 15:50:25 +1000 Subject: [PATCH] Add option to always auto-restart --- tools/arkmanager | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/arkmanager b/tools/arkmanager index d12903c..ffa3dc0 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -742,6 +742,9 @@ doRun() { # Disable auto-restart so we don't get caught in a restart loop rm -f "$arkserverroot/$arkautorestartfile" restartserver=0 + if [ -n "$arkAlwaysRestartOnCrash" ]; then + restartserver=1 + fi sleep 5 @@ -762,6 +765,8 @@ doRun() { echo "`timestamp`: Bad PID '$pid'; expected '$serverpid'" if [ "$pid" != "" ]; then # Another instance must be running - disable autorestart + echo "Error: another server instance is running from the same directory" + echo "Aborting - two servers MUST NOT run from the same directory" restartserver=0 fi break @@ -797,6 +802,10 @@ doStart() { doUpdate --update-mods fi fi + + if [[ " $* " =~ " --alwaysrestart " ]]; then + arkAlwaysRestartOnCrash=true + fi tput sc echo "The server is starting..."