either i fked the launch menu or made it better

This commit is contained in:
CerberusV1
2024-10-16 12:21:59 +02:00
parent 621c15e59b
commit e7ccd11d2f

View File

@@ -37,6 +37,8 @@ while true; do
clear clear
echo " Launch Menu" echo " Launch Menu"
echo "------------------------------------------------------------" echo "------------------------------------------------------------"
read -p "Do you want to start the server? [y/n] " start_answer
if [[ ${eula_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
@@ -51,6 +53,12 @@ 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
break
else
echo "Invalid input"
break
fi
read -p "Press Enter to continue..." read -p "Press Enter to continue..."
break break
;; ;;