minecraft-bukkit-start-script/mc-shutdown
2021-03-13 13:57:25 +00:00

32 lines
951 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# ×=====================×
# | mc-shutdown by peet |
# ×=====================×
if [ "$1" = "-h" ]
then
echo "mc-shutdown [option]"
echo
echo "Options:"
echo " -h Show help"
#echo " -p minigames Server"
#echo " -h Show help"
exit 0
fi
#Initialize variables
password=NisikiTimbukSFSGames
cd /usr/local/bin/
if [ -z "$1"]
then
# First shutdown waterfall, so all connections are closed
./mcrcon -H 192.168.178.20 -P 25577 -p $password -w 5 "alert Server is shutting down!" end
./mcrcon -H 192.168.178.20 -P 25578 -p $password -w 5 save-all stop
./mcrcon -H 192.168.178.20 -P 25579 -p $password -w 5 save-all stop
./mcrcon -H 192.168.178.22 -P 25580 -p $password -w 5 save-all stop
./mcrcon -H 192.168.178.22 -P 25581 -p $password -w 5 save-all stop
./mcrcon -H 192.168.178.21 -P 25582 -p $password -w 5 save-all stop
./mcrcon -H 192.168.178.21 -P 25583 -p $password -w 5 save-all stop
fi