fixed y/n layer for starting the server

This commit is contained in:
CerberusV1
2024-10-16 14:43:13 +02:00
parent 95b8012db3
commit d2c6ad9984

View File

@@ -38,7 +38,7 @@ while true; do
echo " Launch Menu" echo " Launch Menu"
echo "------------------------------------------------------------" echo "------------------------------------------------------------"
read -p "Do you want to start the server? [y/n] " start_answer # Promting before actually starting the server read -p "Do you want to start the server? [y/n] " start_answer # Promting before actually starting the server
if [[ ${eula_answer} == "y" ]]; then if [[ ${start_answer} == "y" ]]; then
if [[ -e "${server}/eula.txt" ]]; then # Checks if the EULA file exists 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 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 if [[ ${condition} -eq 1 ]]; then # If EULA is accepted, start the server
@@ -53,7 +53,7 @@ while true; do
else else
echo "Before starting the server, please accept the EULA" echo "Before starting the server, please accept the EULA"
fi fi
elif [[ ${eula_answer} == "n" ]]; then elif [[ ${start_answer} == "n" ]]; then
break break
else else
echo "Invalid input" echo "Invalid input"