improved outputs

This commit is contained in:
FezVrasta 2015-06-23 23:38:06 +02:00
parent f9c97a2bd2
commit 911ec781b7

View File

@ -49,11 +49,13 @@ function testfunction(){
# #
function checkForUpdate(){ function checkForUpdate(){
if isUpdateNeeded; then if isUpdateNeeded; then
tput rc; tput ed;
echo -e "Current version:" "$RED" $instver "$NORMAL" echo -e "Current version:" "$RED" $instver "$NORMAL"
echo -e "Available version:" "$GREEN" $bnumber "$NORMAL" echo -e "Available version:" "$GREEN" $bnumber "$NORMAL"
echo -e "Your server needs to be restarted in order to receive the latest update." echo -e "Your server needs to be restarted in order to receive the latest update."
echo -e "Run \"arkmanager update\" to do so" echo -e "Run \"arkmanager update\" to do so"
else else
tput rc; tput ed;
echo -e "Current version:" "$GREEN" $instver "$NORMAL" echo -e "Current version:" "$GREEN" $instver "$NORMAL"
echo -e "Available version:" "$GREEN" $bnumber "$NORMAL" echo -e "Available version:" "$GREEN" $bnumber "$NORMAL"
echo "Your server is up to date!" echo "Your server is up to date!"
@ -165,10 +167,13 @@ doStart() {
# #
doStop() { doStop() {
if isTheServerRunning; then if isTheServerRunning; then
tput sc
echo "Stopping server..." echo "Stopping server..."
# kill the server with the PID # kill the server with the PID
PID=`ps -ef | grep "$arkserverroot/$arkserverexec" | grep -v grep | awk '{print $2}'` PID=`ps -ef | grep "$arkserverroot/$arkserverexec" | grep -v grep | awk '{print $2}'`
kill -9 $PID kill -9 $PID
tput rc; tput ed;
echo "$timestamp: stop" >> "$logdir/arkserver.log" echo "$timestamp: stop" >> "$logdir/arkserver.log"
else else
echo "The server is already stopped" echo "The server is already stopped"
@ -264,6 +269,8 @@ case "$1" in
#testfunction #testfunction
;; ;;
checkupdate) checkupdate)
tput sc
echo "Querying Steam database for latest version..."
checkForUpdate checkForUpdate
;; ;;
broadcast) broadcast)