From aeafb3f5b9ca96720d051f0f3761b3d2445b75e6 Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Sun, 11 Oct 2015 17:18:13 +1000 Subject: [PATCH 1/4] Fix error with checkupdate when steam unreachable Fixes: 0e6dfc2 (Don't report update available if steam unreachable) --- tools/arkmanager | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/arkmanager b/tools/arkmanager index 5321bea..94683f8 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -311,7 +311,7 @@ function checkForUpdate(){ function isUpdateNeeded(){ getCurrentVersion getAvailableVersion - if [ "$bnumber" = "Unknown" -o "$bnumber" -eq "$instver" ]; then + if [[ "$bnumber" == "Unknown" || "$bnumber" -eq "$instver" ]]; then return 1 # no update needed else return 0 # update needed @@ -355,7 +355,6 @@ function getCurrentVersion(){ else instver="" fi - return $instver } # @@ -367,7 +366,6 @@ function getAvailableVersion(){ if [ -z "$bnumber" ]; then bnumber="Unknown" fi - return $bnumber } # From 1165dc15093e7ba79b9b5c254ce8d9257c3b22f3 Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Mon, 12 Oct 2015 06:15:54 +1000 Subject: [PATCH 2/4] Update installer for new systemd scripts --- tools/install.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index 9d4c1c3..737a32b 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -213,11 +213,12 @@ else # on debian 8, sysvinit and systemd are present. If systemd is available we use it instead of sysvinit if [ -f /etc/systemd/system.conf ]; then # used by systemd mkdir -p "${INSTALL_ROOT}${LIBEXECDIR}" - cp lsb/arkdaemon "${INSTALL_ROOT}${LIBEXECDIR}/arkmanager.init" + cp systemd/arkmanager.init "${INSTALL_ROOT}${LIBEXECDIR}/arkmanager.init" chmod +x "${INSTALL_ROOT}${LIBEXECDIR}/arkmanager.init" - cp systemd/arkdeamon.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service" + cp systemd/arkmanager.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service" sed -i "s|=/usr/libexec/arkmanager/|=${LIBEXECDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service" - sed -i "s@^DAEMON=\"/usr/bin/@DAEMON=\"${BINDIR}/@" "${INSTALL_ROOT}${LIBEXECDIR}/arkmanager.init" + cp systemd/arkmanager@.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service" + sed -i "s|=/usr/bin/|=${BINDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service" if [ -z "${INSTALL_ROOT}" ]; then systemctl daemon-reload systemctl enable arkmanager.service @@ -239,11 +240,12 @@ else # on RHEL 7, sysvinit and systemd are present. If systemd is available we use it instead of sysvinit if [ -f /etc/systemd/system.conf ]; then # used by systemd mkdir -p "${INSTALL_ROOT}${LIBEXECDIR}" - cp redhat/arkdaemon "${INSTALL_ROOT}${LIBEXECDIR}/arkmanager.init" + cp systemd/arkmanager.init "${INSTALL_ROOT}${LIBEXECDIR}/arkmanager.init" chmod +x "${INSTALL_ROOT}${LIBEXECDIR}/arkmanager.init" - cp systemd/arkdeamon.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service" + cp systemd/arkmanager.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service" sed -i "s|=/usr/libexec/arkmanager/|=${LIBEXECDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service" - sed -i "s@^DAEMON=\"/usr/bin/@DAEMON=\"${BINDIR}/@" "${INSTALL_ROOT}${LIBEXECDIR}/arkmanager.init" + cp systemd/arkmanager@.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service" + sed -i "s|=/usr/bin/|=${BINDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager.service" if [ -z "${INSTALL_ROOT}" ]; then systemctl daemon-reload systemctl enable arkmanager.service @@ -278,6 +280,7 @@ else cp systemd/arkmanager@.service "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service" sed -i "s|=/usr/bin/|=${BINDIR}/|" "${INSTALL_ROOT}/etc/systemd/system/arkmanager@.service" if [ -z "${INSTALL_ROOT}" ]; then + systemctl daemon-reload systemctl enable arkmanager.service echo "Ark server will now start on boot, if you want to remove this feature run the following line" echo "systemctl disable arkmanager.service" From b2e041413ac60795dd8318b8d8c45c4c21251cd7 Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Mon, 12 Oct 2015 06:21:38 +1000 Subject: [PATCH 3/4] Fix "arkmanager installed" to use steamcmd_user --- netinstall.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netinstall.sh b/netinstall.sh index 37eb54e..867428f 100644 --- a/netinstall.sh +++ b/netinstall.sh @@ -44,7 +44,7 @@ rm -rf /tmp/ark-server-tools-${channel} # Print messages case "$status" in "0") - echo "ARK Server Tools were correctly installed in your system inside the home directory of $1!" + echo "ARK Server Tools were correctly installed in your system inside the home directory of $steamcmd_user!" ;; "1") @@ -52,6 +52,6 @@ case "$status" in ;; "2") echo "WARNING: 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 "ARK Server Tools were correctly installed in your system inside the home directory of $1!" + echo "ARK Server Tools were correctly installed in your system inside the home directory of $steamcmd_user!" ;; esac From 29b952eda16139c1e075c6fb812736784abc0e5e Mon Sep 17 00:00:00 2001 From: Ben Peddell Date: Mon, 12 Oct 2015 06:27:20 +1000 Subject: [PATCH 4/4] Exit arkmanager after upgrade --- tools/arkmanager | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/arkmanager b/tools/arkmanager index 94683f8..115d329 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -43,7 +43,6 @@ doUpgradeTools() { echo -en "\n" if [[ $REPLY =~ ^[Yy]$ ]]; then curl -s https://raw.githubusercontent.com/FezVrasta/ark-server-tools/${arkstChannel}/netinstall.sh | $sudo bash -s -- ${steamcmd_user} ${arkstChannel} "${reinstall_args[@]}" - else exit 0 fi elif [[ $arkstLatestVersion == $arkstVersion && "$arkstLatestCommit" != "$arkstCommit" ]]; then @@ -51,7 +50,6 @@ doUpgradeTools() { echo -en "\n" if [[ $REPLY =~ ^[Yy]$ ]]; then curl -s https://raw.githubusercontent.com/FezVrasta/ark-server-tools/${arkstChannel}/netinstall.sh | $sudo bash -s -- ${steamcmd_user} ${arkstChannel} "${reinstall_args[@]}" - else exit 0 fi else