From 39c649d296bd2d216bd10fe5b76e4a1d46928b6e Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Wed, 16 Sep 2015 19:02:48 +1000 Subject: [PATCH] Merge forceUpdate into doUpdate --- tools/arkmanager | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/tools/arkmanager b/tools/arkmanager index d1c0caa..4cd7195 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -540,32 +540,29 @@ doUpdate() { fi fi - forceUpdate + # check if the server was alive before the update so we can launch it back after the update + serverWasAlive=0 + if isTheServerRunning ;then + serverWasAlive=1 + fi + doStop + + cd "$steamcmdroot" + ./$steamcmdexec +login anonymous +force_install_dir "$arkserverroot" +app_update $appid +quit + # the current version should be the last version. We set our version + getCurrentVersion + echo "`timestamp`: update to $instver complete" >> "$logdir/update.log" + + # we restart the server only if it was started before the update + if [ $serverWasAlive -eq 1 ]; then + doStart + fi else echo "Your server is already up to date! The most recent version is ${bnumber}." echo "`timestamp`: No update needed." >> "$logdir/update.log" fi; } -forceUpdate(){ - # check if the server was alive before the update so we can launch it back after the update - serverWasAlive=0 - if isTheServerRunning ;then - serverWasAlive=1 - fi - doStop - cd "$steamcmdroot" - ./$steamcmdexec +login anonymous +force_install_dir "$arkserverroot" +app_update $appid +quit - # the current version should be the last version. We set our version - getCurrentVersion - echo "`timestamp`: update to $instver complete" >> "$logdir/update.log" - - # we restart the server only if it was started before the update - if [ $serverWasAlive -eq 1 ]; then - doStart - fi -} - # # Downloads mod and installs it into mods directory #