=================================================================== RCS file: /cvs/mtctl/mtctl_default.sh,v retrieving revision 1.3 retrieving revision 1.4 diff -u -p -r1.3 -r1.4 --- mtctl/mtctl_default.sh 2021/09/26 14:02:56 1.3 +++ mtctl/mtctl_default.sh 2021/10/19 10:05:56 1.4 @@ -3,7 +3,7 @@ # Purpose: Minetest server Control # License: Copyright (C) 2021 by Miniontoby #--------------------------------------------------------------------- -VERSION="1.2" +VERSION="1.3" config=[] config[0]="no"; config[1]="/usr/local/share/minetest/" @@ -99,7 +99,9 @@ mtstatus() { CHECK="Offline" fi EXTRA="\n" - else if [ "$CHECK" == "Failed" ]; then EXTRA=" \n"; fi; fi + elif [ "$CHECK" == "Failed" ]; then EXTRA=" \n"; + elif [ "$CHECK" == "Backup failed" ]; then EXTRA=" \n"; + elif [ "$CHECK" == "Backup success" ]; then EXTRA=" \n"; fi echo -ne "\r$NAME($CHECK)$EXTRA" } @@ -167,8 +169,15 @@ restartMT() { } statusMT() { - SetWorld "$1"; - mtstatus "Ok" + SetWorld "$1" + GetPIDS "$WORLDDIR" "$NAME" + if [ "x$FOO$BAR" \!= "x" ]; then + STATUS="Online" + else + STATUS="Offline" + fi + LASTLOG="`tail -n 5 $LOGDIR/$NAME.log`" + echo -e "mtctl.$1 - The Minetest Server Control\n Active: $STATUS\n Process: $FOO\n Main PID: $BAR\n\n$LASTLOG" } listMT() { @@ -291,7 +300,7 @@ case $ACTION in NEWESTVERSION=$(curl https://cvsweb.planetofnix.com/cgi-bin/cvsweb/~checkout~/mtctl/version.txt?content-type=text/plain 2> /dev/null) if [ "$NEWESTVERSION" \!= "$VERSION" ]; then mtinfo "Update avaible!\n\nInstalling update NOW!" - curl -sSLk https://ircforever.org/mtctl.php | $SHELL + curl -sSL https://ircforever.org/mtctl.php | $SHELL fi ;; help)