[BACK]Return to mtctl_default.sh CVS log [TXT][DIR] Up to [local] / mtctl

Diff for /mtctl/mtctl_default.sh between version 1.3 and 1.4

version 1.3, 2021/09/26 14:02:56 version 1.4, 2021/10/19 10:05:56
Line 3 
Line 3 
 # Purpose: Minetest server Control  # Purpose: Minetest server Control
 # License: Copyright (C) 2021 by Miniontoby <miniontoby@ircnow.org>  # License: Copyright (C) 2021 by Miniontoby <miniontoby@ircnow.org>
 #---------------------------------------------------------------------  #---------------------------------------------------------------------
 VERSION="1.2"  VERSION="1.3"
 config=[]  config=[]
 config[0]="no"; config[1]="/usr/local/share/minetest/"  config[0]="no"; config[1]="/usr/local/share/minetest/"
   
Line 99  mtstatus() {
Line 99  mtstatus() {
                         CHECK="Offline"                          CHECK="Offline"
                 fi                  fi
                 EXTRA="\n"                  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"          echo -ne "\r$NAME($CHECK)$EXTRA"
 }  }
   
Line 167  restartMT() {
Line 169  restartMT() {
 }  }
   
 statusMT() {  statusMT() {
         SetWorld "$1";          SetWorld "$1"
         mtstatus "Ok"          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() {  listMT() {
Line 291  case $ACTION in
Line 300  case $ACTION in
                 NEWESTVERSION=$(curl https://cvsweb.planetofnix.com/cgi-bin/cvsweb/~checkout~/mtctl/version.txt?content-type=text/plain 2> /dev/null)                  NEWESTVERSION=$(curl https://cvsweb.planetofnix.com/cgi-bin/cvsweb/~checkout~/mtctl/version.txt?content-type=text/plain 2> /dev/null)
                 if [ "$NEWESTVERSION" \!= "$VERSION" ]; then                  if [ "$NEWESTVERSION" \!= "$VERSION" ]; then
                         mtinfo "Update avaible!\n\nInstalling update NOW!"                          mtinfo "Update avaible!\n\nInstalling update NOW!"
                         curl -sSLk https://ircforever.org/mtctl.php | $SHELL                          curl -sSL https://ircforever.org/mtctl.php | $SHELL
                 fi                  fi
                 ;;                  ;;
         help)          help)

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

CVSweb