From 01de51b1db06de9999250f49b11e7d881d56bc78 Mon Sep 17 00:00:00 2001 From: FezVrasta Date: Mon, 22 Jun 2015 10:36:12 +0200 Subject: [PATCH 01/10] fixed netinstall --- netinstall.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/netinstall.sh b/netinstall.sh index 1f5f9bd..86d3110 100644 --- a/netinstall.sh +++ b/netinstall.sh @@ -21,15 +21,15 @@ rm -f master.tar.gz rm -rf /tmp/ark-server-tools-master -if [ $status == 0 ]; then +if [ $status -eq 0 ]; then echo "ARK Server Tools were correctly installed in your system inside the home directory of $1!" fi -if [ $status == 1 ]; then +if [ $status -eq 1 ]; then echo "Something where wrong :(" fi -if [ $status == 2 ]; then +if [ $status -eq 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 From 8f00baaaadb1db156147c66561c527de8365f958 Mon Sep 17 00:00:00 2001 From: FezVrasta Date: Mon, 22 Jun 2015 10:38:14 +0200 Subject: [PATCH 02/10] fixed typo --- netinstall.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/netinstall.sh b/netinstall.sh index 86d3110..5e64414 100644 --- a/netinstall.sh +++ b/netinstall.sh @@ -21,15 +21,15 @@ rm -f master.tar.gz rm -rf /tmp/ark-server-tools-master -if [ $status -eq 0 ]; then +if [ "$status" -eq "0" ]; then echo "ARK Server Tools were correctly installed in your system inside the home directory of $1!" fi -if [ $status -eq 1 ]; then +if [ "$status" -eq "1" ]; then echo "Something where wrong :(" fi -if [ $status -eq 2 ]; then +if [ "$status" -eq "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 From 2abfc7057c69e92218c77838e9d867af41e8decd Mon Sep 17 00:00:00 2001 From: FezVrasta Date: Mon, 22 Jun 2015 10:40:06 +0200 Subject: [PATCH 03/10] probably netinstaller is fixed.. --- netinstall.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/netinstall.sh b/netinstall.sh index 5e64414..db0a6db 100644 --- a/netinstall.sh +++ b/netinstall.sh @@ -21,15 +21,15 @@ rm -f master.tar.gz rm -rf /tmp/ark-server-tools-master -if [ "$status" -eq "0" ]; then +if (( $status == 0 )); then echo "ARK Server Tools were correctly installed in your system inside the home directory of $1!" fi -if [ "$status" -eq "1" ]; then +if (( $status == 1 )); then echo "Something where wrong :(" fi -if [ "$status" -eq "2" ]; then +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 From 3303a43cab2009deb143d2043078b2d3d05c953d Mon Sep 17 00:00:00 2001 From: FezVrasta Date: Mon, 22 Jun 2015 10:44:40 +0200 Subject: [PATCH 04/10] finally fixing the netinstaller --- netinstall.sh | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/netinstall.sh b/netinstall.sh index db0a6db..f3ca0e6 100644 --- a/netinstall.sh +++ b/netinstall.sh @@ -14,22 +14,23 @@ cd ark-server-tools-master/tools chmod +x install.sh sh install.sh $1 -status = $? +status=$? # Remove the installation files rm -f master.tar.gz rm -rf /tmp/ark-server-tools-master +# Print messages +case "$status" in + "0") + echo "ARK Server Tools were correctly installed in your system inside the home directory of $1!" + ;; -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 + "1") + echo "Something where wrong :(" + ;; + "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!" + ;; +esac From c6b9a70066f21026917036438d3600cabce0e414 Mon Sep 17 00:00:00 2001 From: FezVrasta Date: Mon, 22 Jun 2015 10:48:34 +0200 Subject: [PATCH 05/10] fixed command to copy configuration --- tools/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/install.sh b/tools/install.sh index 1a02ac9..4cd4e1a 100644 --- a/tools/install.sh +++ b/tools/install.sh @@ -14,7 +14,7 @@ if [ ! -z $1 ]; then chown $1 /var/log/arktools # Copy arkmanager.cfg inside linux configuation folder if it doesn't already exists - if [ -f /etc/arkmanager/arkmanager.cfg ]; then + 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 From 46240bb169d2ade58c9cc99512adccd13645295f Mon Sep 17 00:00:00 2001 From: FezVrasta Date: Mon, 22 Jun 2015 10:49:02 +0200 Subject: [PATCH 06/10] don't print output of install script but use only exit codes --- netinstall.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netinstall.sh b/netinstall.sh index f3ca0e6..b0907c3 100644 --- a/netinstall.sh +++ b/netinstall.sh @@ -12,7 +12,7 @@ tar -zxvf master.tar.gz # Install ARK Server Tools cd ark-server-tools-master/tools chmod +x install.sh -sh install.sh $1 +sh install.sh $1 > /dev/null status=$? From f91f9f145f6b5e2d2deceeab78991b5ebb2a8c60 Mon Sep 17 00:00:00 2001 From: Sispheor Date: Mon, 22 Jun 2015 19:55:57 +0200 Subject: [PATCH 07/10] remove send mail --- tools/arkmanager | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/arkmanager b/tools/arkmanager index 8d6727b..e7d7bd4 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -139,7 +139,7 @@ doStop() { # kill the server with the PID PID=`ps -ef | grep "$arkserverroot/$arkserverexec" | grep -v grep | awk '{print $2}'` kill -9 $PID - echo "$timestamp: stop" >> "$logdir/arkserver.log" + echo "$timestamp: stop" >> "$logdir/arkserver.log" else echo "The server is already stopped" fi @@ -194,11 +194,7 @@ doUpdate() { # we restart the server only if it was started before the update if [ $serverWasAlive -eq 1 ]; then doStart - fi - # send mail to admin - #if [ -z $servermail ]; then - # mail -a $logdir/update.log -s "Update-Log" $servermail < /dev/null - #fi + fi else echo "No update available" echo "$timestamp: No update needed." >> "$logdir/update.log" From 13b5719adeaae70892f9338be7d61b9dc8b49754 Mon Sep 17 00:00:00 2001 From: Sispheor Date: Mon, 22 Jun 2015 19:57:22 +0200 Subject: [PATCH 08/10] remove tail, arkdaemon show ok or fail message --- tools/arkmanager | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/arkmanager b/tools/arkmanager index e7d7bd4..f3a4139 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -194,7 +194,7 @@ doUpdate() { # we restart the server only if it was started before the update if [ $serverWasAlive -eq 1 ]; then doStart - fi + fi else echo "No update available" echo "$timestamp: No update needed." >> "$logdir/update.log" @@ -246,13 +246,10 @@ case "$1" in restart) doStop echo "$timestamp: stop" >> "$logdir/arkserver.log" - tail -n 1 "$logdir/arkserver.log" sleep 10 doStart echo "$timestamp: start" >> "$logdir/arkserver.log" - tail -n 1 "$logdir/arkserver.log" - echo "$timestamp: restart" >> "$logdir/arkserver.log" - tail -n 1 "$logdir/arkserver.log" + echo "$timestamp: restart" >> "$logdir/arkserver.log" ;; install) doInstall From 621f007671bbede7ae71ad680e318f438abe5079 Mon Sep 17 00:00:00 2001 From: Sispheor Date: Mon, 22 Jun 2015 19:58:21 +0200 Subject: [PATCH 09/10] remove broadcast message feature. Waiting for RCON to do that properly --- README.md | 7 ------- tools/arkmanager | 12 +----------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/README.md b/README.md index 1af93be..dc41101 100644 --- a/README.md +++ b/README.md @@ -72,13 +72,6 @@ Get the status of the server. Show if the process is running, if the server is u #### arkmanager checkupdate Check if a new version of the server is available but not apply it -#### arkmanager broadcast [message] -broadcast a message to ARK server chat - -```sh -arkmanager broadcast "your message here" -``` - ## Credits Original author of arkmanager: LeXaT diff --git a/tools/arkmanager b/tools/arkmanager index f3a4139..bf2bd38 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -202,16 +202,6 @@ doUpdate() { fi; } -# -# Broadcast message to server -# -doInfo() { - if [ ! -z $1 ]; then - info=$1 - fi - screen -S "$servicename" -p 0 -X stuff "broadcast $info $(printf \\r)" -} - # # Print the status of the server (running? online? version?) # @@ -249,7 +239,7 @@ case "$1" in sleep 10 doStart echo "$timestamp: start" >> "$logdir/arkserver.log" - echo "$timestamp: restart" >> "$logdir/arkserver.log" + echo "$timestamp: restart" >> "$logdir/arkserver.log" ;; install) doInstall From 7b80d8b89c190d141e7cb1f5bd1138768c9d1522 Mon Sep 17 00:00:00 2001 From: Sispheor Date: Mon, 22 Jun 2015 21:44:12 +0200 Subject: [PATCH 10/10] fix install --- tools/arkmanager | 3 +-- tools/install.sh | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/arkmanager b/tools/arkmanager index bf2bd38..0128e93 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -189,8 +189,7 @@ doUpdate() { echo "$bnumber" > "$arkserverroot/arkversion" cd $steamcmdroot echo "$timestamp: update to $bnumber complete" >> "$logdir/update.log" - tail -n 1 "$logdir/arkserver.log" - + # we restart the server only if it was started before the update if [ $serverWasAlive -eq 1 ]; then doStart diff --git a/tools/install.sh b/tools/install.sh index 0de4d7b..24a34e7 100644 --- a/tools/install.sh +++ b/tools/install.sh @@ -9,7 +9,7 @@ if [ ! -z $1 ]; then cp arkdaemon /etc/init.d/arkdaemon chmod +x /etc/init.d/arkdaemon # add to startup if the system use sysinit - if [ test -x /usr/sbin/update-rc.d ]; then + if [ -x /usr/sbin/update-rc.d ]; then update-rc.d arkdaemon defaults echo "Ark server will now start on boot, if you want to remove this feature run the following line" echo "update-rc.d -f arkdaemon remove" @@ -21,9 +21,7 @@ if [ ! -z $1 ]; then # Copy arkmanager.cfg inside linux configuation folder if it doesn't already exists if [ -f /etc/arkmanager/arkmanager.cfg ]; then - mkdir -p /etc/arkmanager - if [ -f /etc/arkmanager/arkmanager.cfg ]; then - 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 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 else cp -n arkmanager.cfg /etc/arkmanager/arkmanager.cfg