Daniel Gibbs 9 ani în urmă
părinte
comite
f7d82e0bbf

+ 31 - 0
lgsm/functions/install_minecraft_eula.sh

@@ -0,0 +1,31 @@
+#!/bin/bash
+# LGSM install_minecraft_eula.sh function
+# Author: Daniel Gibbs
+# Website: https://gameservermanagers.com
+# Description: Gets user to accept the EULA.
+
+echo ""
+echo "Accept ${gamename} EULA"
+echo "================================="
+sleep 1
+echo "You are required to accept the EULA:"
+echo "https://account.mojang.com/documents/minecraft_eula"
+
+if [ -z "${autoinstall}" ]; then
+echo "By continuing you are indicating your agreement to the EULA."
+echo ""
+	while true; do
+		read -e -i "y" -p "Continue [Y/n]" yn
+		case $yn in
+		[Yy]* ) break;;
+		[Nn]* ) core_exit.sh;;
+		* ) echo "Please answer yes or no.";;
+		esac
+	done
+else
+echo "By using auto-install you are indicating your agreement to the EULA."
+echo ""
+	sleep 5
+fi
+
+sed -i "s/\"eula=false\"/\"eula=true\"/g" serverfiles/eula.txt

+ 1 - 0
lgsm/functions/install_server_files.sh

@@ -97,6 +97,7 @@ if [ "${gamename}" == "TeamSpeak 3" ]; then
 	update_ts3.sh
 elif [ "${gamename}" == "Minecraft" ]; then
 	update_minecraft.sh
+	install_minecraft_eula.sh
 elif [ "${gamename}" == "Mumble" ]; then
 	update_mumble.sh
 elif [ -z "${appid}" ]||[ "${gamename}" == "GoldenEye: Source" ]; then