From fb2110eb2433bcf600ba8a128416dc90722d5b9f Mon Sep 17 00:00:00 2001 From: FezVrasta Date: Sun, 21 Jun 2015 14:09:51 +0200 Subject: [PATCH] install and netinstall can now update existing installation --- netinstall.sh | 21 ++++++++++++++++----- tools/install.sh | 14 ++++++++++---- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/netinstall.sh b/netinstall.sh index b5d4a43..1f5f9bd 100644 --- a/netinstall.sh +++ b/netinstall.sh @@ -12,13 +12,24 @@ tar -zxvf master.tar.gz # Install ARK Server Tools cd ark-server-tools-master/tools chmod +x install.sh -if [[ -n $(sh install.sh $1) ]]; then - echo "Something where wrong :(" -else - echo "ARK Server Tools were correctly installed in your system inside the home directory of $1!" -fi +sh install.sh $1 + +status = $? # Remove the installation files rm -f master.tar.gz rm -rf /tmp/ark-server-tools-master + +if [ $status == 0 ]; then + echo "ARK Server Tools were correctly installed in your system inside the home directory of $1!" +fi + +if [ $status == 1 ]; then + echo "Something where wrong :(" +fi + +if [ $status == 2 ]; then + 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!" +fi diff --git a/tools/install.sh b/tools/install.sh index e4b661d..1a02ac9 100644 --- a/tools/install.sh +++ b/tools/install.sh @@ -13,14 +13,20 @@ if [ ! -z $1 ]; then mkdir -p /var/log/arktools chown $1 /var/log/arktools - # Copy arkmanager.cfg inside linux configuation folder - mkdir -p /etc/arkmanager - mv arkmanager.cfg /etc/arkmanager/arkmanager.cfg - chown $1 /etc/arkmanager/arkmanager.cfg + # Copy arkmanager.cfg inside linux configuation folder if it doesn't already exists + if [ -f /etc/arkmanager/arkmanager.cfg ]; then + mkdir -p /etc/arkmanager + cp -n arkmanager.cfg /etc/arkmanager/arkmanager.cfg + chown $1 /etc/arkmanager/arkmanager.cfg + else + 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."; + exit 2 + fi else echo "You must specify your system steam user who own steamcmd directory to install ARK Tools." echo "Usage: ./install.sh steam" + exit 1 fi exit 0