From 38d9b4e977afa5e9eedb8ef1cffb22e2f5c69b72 Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Fri, 18 Sep 2015 23:56:30 +1000 Subject: [PATCH 1/3] Save world before update Not using isTheServerUp, as doSaveWorld should return immediately if the server is not up. --- tools/arkmanager | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/arkmanager b/tools/arkmanager index 1119d7e..29047a2 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -420,6 +420,8 @@ forceUpdate(){ if isTheServerRunning ;then serverWasAlive=1 fi + echo "Saving world" + doSaveWorld doStop cd "$steamcmdroot" ./$steamcmdexec +login anonymous +force_install_dir "$arkserverroot" +app_update $appid +quit From 4e7fc8f0b1aa88d6619a01a583aac9b281f4e16c Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Sat, 19 Sep 2015 00:05:14 +1000 Subject: [PATCH 2/3] Add --saveworld option to update --- tools/arkmanager | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/arkmanager b/tools/arkmanager index 1680c01..fdb49e4 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -575,6 +575,7 @@ doUpdate() { local updatetype=normal local validate= local modupdate= + local saveworld= for arg in "$@"; do if [ "$arg" == "--force" ]; then @@ -586,6 +587,8 @@ doUpdate() { elif [ "$arg" == "--validate" ]; then validate=validate appupdate=1 + elif [ "$arg" == "--saveworld" ]; then + saveworld=1 elif [ "$arg" == "--update-mods" ]; then modupdate=1 fi @@ -626,8 +629,12 @@ doUpdate() { if isTheServerRunning ;then serverWasAlive=1 fi - echo "Saving world" - doSaveWorld + + if [ -n "$saveworld" ]; then + echo "Saving world" + doSaveWorld + fi + doStop if [ -n "$appupdate" ]; then @@ -1157,6 +1164,7 @@ while true; do echo "update --safe Wait for server to perform world save and update." echo "update --warn Warn players before updating server" echo "update --validate Validates all ARK server files" + echo "update --saveworld Saves world before update" echo "update --update-mods Updates installed and requested mods" echo "upgrade-tools Check for a new ARK Server Tools version and upgrades it if needed" echo "uninstall-tools Uninstall the ARK Server Tools" From c31946525a46bb92445e6cd57f49e7473646a983 Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Sat, 19 Sep 2015 00:09:00 +1000 Subject: [PATCH 3/3] Make it more obvious that update command takes multiple options --- tools/arkmanager | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/arkmanager b/tools/arkmanager index fdb49e4..414493b 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -1159,16 +1159,18 @@ while true; do echo "stop Stops the server" echo "stop --all Stops all servers specified in configfile_xxxxx" echo "status Returns the status of the current ARK server instance" - echo "update Check for a new ARK server version, if needed, stops the server, updates it, and starts it again" - echo "update --force Apply update without checking the current version" - echo "update --safe Wait for server to perform world save and update." - echo "update --warn Warn players before updating server" - echo "update --validate Validates all ARK server files" - echo "update --saveworld Saves world before update" - echo "update --update-mods Updates installed and requested mods" + echo "update [OPTION ...] Check for a new ARK server version, if needed, stops the server, updates it, and starts it again" echo "upgrade-tools Check for a new ARK Server Tools version and upgrades it if needed" echo "uninstall-tools Uninstall the ARK Server Tools" echo "useconfig Use the configuration overrides in the specified config name or file" + echo + echo "Update command takes the below options:" + echo " --force Apply update without checking the current version" + echo " --safe Wait for server to perform world save and update." + echo " --warn Warn players before updating server" + echo " --validate Validates all ARK server files" + echo " --saveworld Saves world before update" + echo " --update-mods Updates installed and requested mods" exit 1 ;; *)