From 3462be3066bf606c467016117ad95e67fb3fa947 Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Sat, 27 Jun 2015 19:55:04 +1000 Subject: [PATCH 1/5] Use getCurrentVersion after update --- tools/arkmanager | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tools/arkmanager b/tools/arkmanager index 0f1b6fa..d3cea38 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -63,14 +63,6 @@ function checkForUpdate(){ fi } -# -# Set the new current version in a file -# -function setCurrentVersion(){ - cd "$arkserverroot" - echo $bnumber > arkversion -} - # # Check if the server need to be updated # Return 0 if update is needed, else return 1 @@ -119,6 +111,7 @@ function parseSteamACF(){ function getCurrentVersion(){ if [ -f "${arkserverroot}/steamapps/appmanifest_${appid}.acf" ]; then instver=`while read name val; do if [ "${name}" == "{" ]; then parseSteamACF "" "buildid"; break; fi; done <"${arkserverroot}/steamapps/appmanifest_${appid}.acf"` + echo $instver > "$arkserverroot/arkversion" else instver="" fi @@ -229,8 +222,7 @@ doInstall() { # install the server ./$steamcmdexec +login anonymous +force_install_dir "$arkserverroot" +app_update $appid validate +quit # the current version should be the last version. We set our version - getAvailableVersion - setCurrentVersion + getCurrentVersion } # @@ -257,8 +249,7 @@ forceUpdate(){ 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 - getAvailableVersion - setCurrentVersion + getCurrentVersion echo "$timestamp: update to $instver complete" >> "$logdir/update.log" # we restart the server only if it was started before the update From 090bf70b11f15599c6549240bd9266ea2fbcd315 Mon Sep 17 00:00:00 2001 From: Marius Linge Date: Sat, 27 Jun 2015 11:56:37 +0200 Subject: [PATCH 2/5] Includes a copy of the newest config file on installation --- tools/install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/install.sh b/tools/install.sh index 420aba1..55d249c 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -86,7 +86,10 @@ if [ ! -z "$1" ]; then # Copy arkmanager.cfg inside linux configuation folder if it doesn't already exists mkdir -p "${INSTALL_ROOT}/etc/arkmanager" if [ -f "${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg" ]; then + cp -n arkmanager.cfg "${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg.NEW" + chown "$1" "${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg.NEW" echo "A previous version of ARK Server Tools was detected in your system, your old configuration was not overwritten. You may need to manually update it." + echo "A copy of the new configuration file was included in /etc/arkmanager. Make sure to review any changes and update your config accordingly!" exit 2 else cp -n arkmanager.cfg "${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg" From 73816a228338e8779aa085bb2eadfed01b7b4f70 Mon Sep 17 00:00:00 2001 From: Q11x Date: Sat, 27 Jun 2015 13:30:05 +0200 Subject: [PATCH 3/5] Update README.md changed the wording a bit, so it would be easier to understand. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d63a35b..fb45856 100644 --- a/README.md +++ b/README.md @@ -65,8 +65,8 @@ ark_ServerPVE=False ark_DifficultyOffset=1 ``` -Your session name may contain special characters (eg. `!![EU]!! Aw&some ARK`) which could break the startup command. -In this case you may want to comment out the `ark_SessionName` variable and define it inside your **GameUserSettings.ini** file. +Your session name may not contain special characters (eg. `!![EU]!! Aw&some ARK`) as it could break the startup command. +In this case you may want to comment out the `ark_SessionName` variable and define it inside your **GameUserSettings.ini** file instead. You can override or add variables for a specific system user creating a file called `.arkmanager.cfg` in the home directory of the system user. From d7004922dd1e813de136a9086cccc4b0c9139d66 Mon Sep 17 00:00:00 2001 From: Fez Vrasta Date: Sat, 27 Jun 2015 18:10:44 +0200 Subject: [PATCH 4/5] Revert "Waiting for world save before update." --- README.md | 3 --- tools/arkmanager | 21 --------------------- 2 files changed, 24 deletions(-) diff --git a/README.md b/README.md index ff03718..d63a35b 100644 --- a/README.md +++ b/README.md @@ -99,9 +99,6 @@ manually updates ARK server if a new version is available #### arkmanager forceupdate Apply update without check the current version -#### arkmanager safeupdate -Waits for server to perform world save and then updates. - #### arkmanager status Get the status of the server. Show if the process is running, if the server is up and the current version number diff --git a/tools/arkmanager b/tools/arkmanager index 8a57114..d3cea38 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -258,26 +258,6 @@ forceUpdate(){ fi } -# -# Waits for server to perform save before update (until save file is newer than 1 minute) -# -safeUpdate(){ - cd "$arkserverroot" - - if isUpdateNeeded; then - while [ ! `find $arkserverroot/ShooterGame/Saved/SavedArks -mmin -1 -name $serverMap.ark` ]; do - echo "$timestamp: Save file older than 1 minute. Delaying update." >> "$logdir/update.log" - sleep 30s - done - echo "$timestamp: Save file newer than 1 minute. Performing an update." >> "$logdir/update.log" - forceUpdate - else - echo "Your server is already up to date! The most recent version is ${bnumber}." - echo "$timestamp: No update needed." >> "$logdir/update.log" - fi -} - - # # Print the status of the server (running? online? version?) # @@ -345,7 +325,6 @@ case "$1" in echo "update Check for a new ARK server version, if needed, stops the server, updates it, and starts it again" echo "forceupdate Apply update without check the current version" echo "checkupdate Check for a new ARK server version" - echo "safeupdate Wait for server to perform world save and update. echo "boradcast PLACEHOLDER, not supported yet" echo "status Returns the status of the current ARK server instance" ;; From a6b0afda6550e2bfce6a460bf92075d2f970b66c Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Sun, 28 Jun 2015 23:32:48 +1000 Subject: [PATCH 5/5] Revert "Revert "Waiting for world save before update."" This reverts commit d7004922dd1e813de136a9086cccc4b0c9139d66. --- README.md | 3 +++ tools/arkmanager | 21 +++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/README.md b/README.md index fb45856..54823ac 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,9 @@ manually updates ARK server if a new version is available #### arkmanager forceupdate Apply update without check the current version +#### arkmanager safeupdate +Waits for server to perform world save and then updates. + #### arkmanager status Get the status of the server. Show if the process is running, if the server is up and the current version number diff --git a/tools/arkmanager b/tools/arkmanager index d3cea38..8a57114 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -258,6 +258,26 @@ forceUpdate(){ fi } +# +# Waits for server to perform save before update (until save file is newer than 1 minute) +# +safeUpdate(){ + cd "$arkserverroot" + + if isUpdateNeeded; then + while [ ! `find $arkserverroot/ShooterGame/Saved/SavedArks -mmin -1 -name $serverMap.ark` ]; do + echo "$timestamp: Save file older than 1 minute. Delaying update." >> "$logdir/update.log" + sleep 30s + done + echo "$timestamp: Save file newer than 1 minute. Performing an update." >> "$logdir/update.log" + forceUpdate + else + echo "Your server is already up to date! The most recent version is ${bnumber}." + echo "$timestamp: No update needed." >> "$logdir/update.log" + fi +} + + # # Print the status of the server (running? online? version?) # @@ -325,6 +345,7 @@ case "$1" in echo "update Check for a new ARK server version, if needed, stops the server, updates it, and starts it again" echo "forceupdate Apply update without check the current version" echo "checkupdate Check for a new ARK server version" + echo "safeupdate Wait for server to perform world save and update. echo "boradcast PLACEHOLDER, not supported yet" echo "status Returns the status of the current ARK server instance" ;;