Add option to always auto-restart

This commit is contained in:
Ben Peddell 2016-07-09 15:50:25 +10:00
parent 55f9a80ddd
commit 794171e7e4

View File

@ -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..."