diff --git a/minecraft/start.sh b/minecraft/start.sh new file mode 100644 index 0000000..aaab658 --- /dev/null +++ b/minecraft/start.sh @@ -0,0 +1,47 @@ +#!/bin/bash +YL='\033[1;33m' #Yellow Text +NC='\033[0m' #No Color +BL='\033[0;34m' #Blue Text + # set an +# Database up checker +clear +printf "${BL}Is the Database Up?${NC}" +echo +echo +read -r -p "Enter your choice y or n : " d + +case $d in + y) clear ;; + n) clear + echo Well, make it so number one + exit 1;; + esac + + while : + do + echo + printf "${YL}Starting Minecraft Server ${NC}" + echo + java -Xmx3072M -jar spigot-1.20.1.jar nogui + # show menu + clear + echo "---------------------------------" + printf "${BL}Server Will Restart in 10 sec${NC}" + echo + echo "---------------------------------" + echo "1. Restart Server Now" + echo "2. Restart in 5 min" + echo "3. Exit" + echo "---------------------------------" + read -r -t 10 -p "Enter your choice [1-3] : " c + # take action + case $c in + 1) pause ;; + 2) for (( i=300; i>0; i--)); do + sleep 1 & + printf "Restarting in ${YL}$i${NC} secconds \r" + wait + done ;; + 3) break;; + esac +done \ No newline at end of file