mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-20 14:08:26 +00:00
Fix double-start when auto-update is enabled
This commit is contained in:
parent
eee006801d
commit
0c2bb68b2e
@ -752,7 +752,7 @@ doStart() {
|
|||||||
if [ "$arkAutoUpdateOnStart" == "true" ]; then
|
if [ "$arkAutoUpdateOnStart" == "true" ]; then
|
||||||
if ! [[ " $* " =~ " --noautoupdate " ]]; then
|
if ! [[ " $* " =~ " --noautoupdate " ]]; then
|
||||||
echo "Updating server"
|
echo "Updating server"
|
||||||
doUpdate --update-mods
|
doUpdate --update-mods --no-autostart
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
tput sc
|
tput sc
|
||||||
@ -991,6 +991,7 @@ doUpdate() {
|
|||||||
local modupdate=
|
local modupdate=
|
||||||
local saveworld=
|
local saveworld=
|
||||||
local downloadonly=
|
local downloadonly=
|
||||||
|
local noautostart=
|
||||||
|
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
if [ "$arg" == "--force" ]; then
|
if [ "$arg" == "--force" ]; then
|
||||||
@ -1010,6 +1011,8 @@ doUpdate() {
|
|||||||
modupdate=1
|
modupdate=1
|
||||||
elif [ "$arg" == "--backup" ]; then
|
elif [ "$arg" == "--backup" ]; then
|
||||||
arkBackupPreUpdate=true
|
arkBackupPreUpdate=true
|
||||||
|
elif [ "$arg" == "--no-autostart" ]; then
|
||||||
|
noautostart=1
|
||||||
elif [[ "$arg" =~ ^--stagingdir= ]]; then
|
elif [[ "$arg" =~ ^--stagingdir= ]]; then
|
||||||
arkStagingDir="${ark#--stagingdir=}"
|
arkStagingDir="${ark#--stagingdir=}"
|
||||||
elif [ "$arg" == "--downloadonly" ]; then
|
elif [ "$arg" == "--downloadonly" ]; then
|
||||||
@ -1174,10 +1177,12 @@ doUpdate() {
|
|||||||
|
|
||||||
rm -f "${arkserverroot}/.ark-update.lock"
|
rm -f "${arkserverroot}/.ark-update.lock"
|
||||||
# we restart the server only if it was started before the update
|
# we restart the server only if it was started before the update
|
||||||
if [ $serverWasAlive -eq 1 ] || [ -f "${arkserverroot}/.startAfterUpdate" ]; then
|
if [ -z "$noautostart" ]; then
|
||||||
rm -f "${arkserverroot}/.startAfterUpdate"
|
if [ $serverWasAlive -eq 1 ] || [ -f "${arkserverroot}/.startAfterUpdate" ]; then
|
||||||
rm -f "${arkserverroot}/.ark-update.lock"
|
rm -f "${arkserverroot}/.startAfterUpdate"
|
||||||
doStart --noautoupdate
|
rm -f "${arkserverroot}/.ark-update.lock"
|
||||||
|
doStart --noautoupdate
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "Your server is already up to date! The most recent version is ${bnumber}."
|
echo "Your server is already up to date! The most recent version is ${bnumber}."
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user