Added the start of the script

This commit is contained in:
Phil 2021-11-13 11:52:13 +00:00
parent 72e134e3fa
commit 7c666367df

98
MC-Server-Toolkit.sh Executable file
View File

@ -0,0 +1,98 @@
#!/bin/bash
## Run as Root
show_menu(){
NORMAL=`echo "\033[m"`
MENU=`echo "\033[36m"` #Blue
NUMBER=`echo "\033[33m"` #yellow
FGRED=`echo "\033[41m"`
RED_TEXT=`echo "\033[31m"`
ENTER_LINE=`echo "\033[33m"`
echo -e "${MENU}*********************************************${NORMAL}"
echo -e "Spigot Minecraft Server Toolkit "
echo -e "\t by Phil | https://www.NCLtech.co.uk"
echo -e "${MENU}**${NUMBER} 1)${MENU} Setup a Server ${NORMAL}"
echo -e "${MENU}**${NUMBER} 2)${MENU} Update a Server ${NORMAL}"
## echo -e "${MENU}**${NUMBER} 3)${MENU} Install Standard Edition ${NORMAL}"
## echo -e "${MENU}**${NUMBER} 4)${MENU} Install Full Edition ${NORMAL}"
## echo -e "${MENU}**${NUMBER} 5)${MENU} Install Home Edition ${NORMAL}"
## echo -e "${MENU}**${NUMBER} 6)${MENU} Install Embedded Edition ${NORMAL}"
echo -e "${MENU}*********************************************${NORMAL}"
echo -e "${ENTER_LINE}Choose a menu option and enter or ${RED_TEXT}enter to exit. ${NORMAL}"
read opt
}
function option_picked() {
COLOR='\033[01;31m' # bold red
RESET='\033[00;00m' # normal white
MESSAGE=${@:-"${RESET}Error: No message passed"}
echo -e "${COLOR}${MESSAGE}${RESET}"
}
function setup_server() {
}
function update_server() {
if [[ -f "/usr/minecraft" ]];then
echo "Updating Server..."
if [[ -f "/home/MC-Builder" ]];then
cd /
else
echo "No Snap Found"
else
echo "No Server Folder Found"
}
function init_function() {
clear
show_menu
while [ opt != '' ]
do
if [[ $opt = "" ]]; then
exit;
else
case $opt in
1) clear;
option_picked "Installing Server Instance";
setup_server;
option_picked "Server Install Complete";
exit;
;;
2) clear;
option_picked "Updating Server Instance";
update_server;
option_picked "Server Update Complete";
exit;
;;
x)exit;
;;
q)exit;
;;
\n)exit;
;;
*)clear;
option_picked "Choose One of The Options from the Menu";
show_menu;
;;
esac
fi
done
}
if [ `whoami` == "root" ]; then
init_function;
else
echo "This script needs to be run as root!"
fi