mirror of
https://github.com/CerberusV1/minecraft_deploy.git
synced 2026-01-13 03:23:42 +01:00
commenting
This commit is contained in:
@@ -26,10 +26,10 @@ PS3=""
|
||||
while true; do
|
||||
clear
|
||||
# Optionen definieren
|
||||
options=("Start Server" "Connect to Server" "Set EULA" "Set RAM" "Install Mods" "Exit")
|
||||
options=("Start Server" "Connect to Server" "Set EULA" "Set RAM" "Install Mods" "Exit") # Lists all the Options available in the script
|
||||
echo "ServerManager"
|
||||
echo "----------------------------------------------"
|
||||
select opt in "${options[@]}"; do
|
||||
select opt in "${options[@]}"; do # Selects an option from a list and then does this
|
||||
case $opt in
|
||||
"Start Server")
|
||||
# Add an interaction Do you want to start the server y/n, so he is not starting
|
||||
@@ -37,13 +37,13 @@ while true; do
|
||||
clear
|
||||
echo "Launch Menu"
|
||||
echo "------------------------------------------------------------"
|
||||
if [[ -e "${server}/eula.txt" ]]; then
|
||||
condition=$(cat "${server}/eula.txt" | grep -c "eula=true")
|
||||
if [[ ${condition} -eq 1 ]]; then
|
||||
if [[ -e "${server}/eula.txt" ]]; then # Checks if the EULA file exists
|
||||
condition=$(cat "${server}/eula.txt" | grep -c "eula=true") # Sets the condition, in this case counting how many lines with eula=true exist in the EULA file
|
||||
if [[ ${condition} -eq 1 ]]; then # If EULA is accepted, start the server
|
||||
echo "Starting Server...."
|
||||
cd "${server}"
|
||||
tmux new -d -s "${server_name}" "./start_server.sh"
|
||||
elif [[ ${condition} -eq 0 ]]; then
|
||||
cd "${server}" # Change directory to where the start script is to avoid a tmux exit
|
||||
tmux new -d -s "${server_name}" "./start_server.sh" # Starts the server detatched in a new session
|
||||
elif [[ ${condition} -eq 0 ]]; then # If EULA is not accepted, start the server
|
||||
echo "Before starting the server, please accept the EULA"
|
||||
else
|
||||
echo "Something went wrong, please recreate the EULA"
|
||||
@@ -58,8 +58,9 @@ while true; do
|
||||
clear
|
||||
echo "Launch Menu"
|
||||
echo "------------------------------------------------------------"
|
||||
# Here will be also a check if a session is running. If no session is running, redirect to start the server.
|
||||
tmux a -t "${server_name}"
|
||||
# Add a chck before connecting to the session if the session already exists
|
||||
# if not promt the user to start it manually
|
||||
tmux a -t "${server_name}" # Attaches to the running tmux session of the server if the session exists
|
||||
read -p "Press Enter to continue..."
|
||||
break
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user