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/netinstall.sh b/netinstall.sh index 1f5f9bd..b0907c3 100644 --- a/netinstall.sh +++ b/netinstall.sh @@ -12,24 +12,25 @@ 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 = $? +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 diff --git a/tools/arkmanager b/tools/arkmanager index 3c1facf..cdb99e3 100755 --- a/tools/arkmanager +++ b/tools/arkmanager @@ -168,7 +168,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 @@ -216,16 +216,11 @@ doUpdate() { ./$steamcmdexec +login anonymous +force_install_dir "$arkserverroot" +app_update $appid +quit echo "$bnumber" > "$arkserverroot/arkversion" 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 fi - # send mail to admin - #if [ -z $servermail ]; then - # mail -a $logdir/update.log -s "Update-Log" $servermail < /dev/null - #fi else echo "No update available" echo "$timestamp: No update needed." >> "$logdir/update.log" @@ -233,16 +228,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?) # @@ -277,13 +262,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" ;; install) doInstall diff --git a/tools/install.sh b/tools/install.sh index cc25da8..47c1c73 100644 --- a/tools/install.sh +++ b/tools/install.sh @@ -24,7 +24,7 @@ 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 - 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 "${INSTALL_ROOT}/etc/arkmanager/arkmanager.cfg"