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 diff --git a/tools/arkmanager b/tools/arkmanager index 90e3386..d9b0845 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 @@ -312,7 +310,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 @@ -356,7 +354,6 @@ function getCurrentVersion(){ else instver="" fi - return $instver } # @@ -368,7 +365,6 @@ function getAvailableVersion(){ if [ -z "$bnumber" ]; then bnumber="Unknown" fi - return $bnumber } # 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"