Perform online check even with arkAlwaysRestartOnCrash

This commit is contained in:
Ben Peddell 2018-09-21 01:32:54 +10:00 committed by GitHub
parent 47a668fff4
commit eb5f86e112
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1125,6 +1125,7 @@ doRun() {
# Disable auto-restart so we don't get caught in a restart loop # Disable auto-restart so we don't get caught in a restart loop
rm -f "$arkserverroot/$arkautorestartfile" rm -f "$arkserverroot/$arkautorestartfile"
restartserver=0 restartserver=0
serveronline=0
if [ -n "$arkAlwaysRestartOnCrash" ]; then if [ -n "$arkAlwaysRestartOnCrash" ]; then
restartserver=1 restartserver=1
touch "$arkserverroot/$arkautorestartfile" touch "$arkserverroot/$arkautorestartfile"
@ -1139,14 +1140,17 @@ doRun() {
local pid="`getServerPID`" local pid="`getServerPID`"
if [ "$pid" == "$serverpid" ]; then if [ "$pid" == "$serverpid" ]; then
serverdowntries=0 serverdowntries=0
if [ "$restartserver" -eq 0 ]; then if [ "$serveronline" -eq 0 ]; then
# Check if the server has fully started # Check if the server has fully started
if ! isTheServerUp; then if ! isTheServerUp; then
# Enable auto-restart if the server is up # Enable auto-restart if the server is up
echo "`timestamp`: server is up" echo "`timestamp`: server is up"
notify "${notifyMsgServerUp:-Server is up}" notify "${notifyMsgServerUp:-Server is up}"
touch "$arkserverroot/$arkautorestartfile" if [ "$restartserver" -eq 0 ]; then
restartserver=1 touch "$arkserverroot/$arkautorestartfile"
restartserver=1
fi
serveronline=1
fi fi
elif isTheServerUp; then elif isTheServerUp; then
(( serverdowntries++ )) (( serverdowntries++ ))