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 8d6727b..0128e93 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 @@ -189,16 +189,11 @@ 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 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" @@ -206,16 +201,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?) # @@ -250,13 +235,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 7918678..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" @@ -20,9 +20,8 @@ if [ ! -z $1 ]; then chown $1 /var/log/arktools # Copy arkmanager.cfg inside linux configuation folder if it doesn't already exists - 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