version 1.3, 2021/09/26 14:02:56 |
version 1.4, 2021/10/19 10:05:56 |
|
|
# 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/" |
|
|
|
|
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" |
} |
} |
|
|
|
|
} |
} |
|
|
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() { |
|
|
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) |