mirror of
https://github.com/CerberusV1/minecraft_deploy.git
synced 2026-01-13 03:23:42 +01:00
either i fked the launch menu or made it better
This commit is contained in:
@@ -37,19 +37,27 @@ while true; do
|
|||||||
clear
|
clear
|
||||||
echo " Launch Menu"
|
echo " Launch Menu"
|
||||||
echo "------------------------------------------------------------"
|
echo "------------------------------------------------------------"
|
||||||
if [[ -e "${server}/eula.txt" ]]; then # Checks if the EULA file exists
|
read -p "Do you want to start the server? [y/n] " start_answer
|
||||||
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 [[ ${eula_answer} == "y" ]]; then
|
||||||
if [[ ${condition} -eq 1 ]]; then # If EULA is accepted, start the server
|
if [[ -e "${server}/eula.txt" ]]; then # Checks if the EULA file exists
|
||||||
echo "Starting Server...."
|
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
|
||||||
cd "${server}" # Change directory to where the start script is to avoid a tmux exit
|
if [[ ${condition} -eq 1 ]]; then # If EULA is accepted, start the server
|
||||||
tmux new -d -s "${server_name}" "./start_server.sh" # Starts the server detatched in a new session
|
echo "Starting Server...."
|
||||||
elif [[ ${condition} -eq 0 ]]; then # If EULA is not accepted, start the server
|
cd "${server}" # Change directory to where the start script is to avoid a tmux exit
|
||||||
echo "Before starting the server, please accept the EULA"
|
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"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Something went wrong, please recreate the EULA"
|
echo "Before starting the server, please accept the EULA"
|
||||||
fi
|
fi
|
||||||
|
elif [[ ${eula_answer} == "n" ]]; then
|
||||||
|
break
|
||||||
else
|
else
|
||||||
echo "Before starting the server, please accept the EULA"
|
echo "Invalid input"
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
read -p "Press Enter to continue..."
|
read -p "Press Enter to continue..."
|
||||||
break
|
break
|
||||||
@@ -77,7 +85,7 @@ while true; do
|
|||||||
if [[ ${eula_answer} == "y" ]]; then
|
if [[ ${eula_answer} == "y" ]]; then
|
||||||
echo "# ${current_date}" > "${server}/eula.txt"
|
echo "# ${current_date}" > "${server}/eula.txt"
|
||||||
echo "eula=true" >> "${server}/eula.txt"
|
echo "eula=true" >> "${server}/eula.txt"
|
||||||
elif [[ ${eula_answer} == "n" ]]; then
|
elif [[ ${eula_answer} == "n" ]]; then
|
||||||
echo "# ${current_date}" > "${server}/eula.txt"
|
echo "# ${current_date}" > "${server}/eula.txt"
|
||||||
echo "eula=false" >> "${server}/eula.txt"
|
echo "eula=false" >> "${server}/eula.txt"
|
||||||
echo "You will not be able to start the server!"
|
echo "You will not be able to start the server!"
|
||||||
|
|||||||
Reference in New Issue
Block a user