install_eula.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash
  2. # LinuxGSM install_eula.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: http://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Gets user to accept the EULA.
  7. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. if [ "${shortname}" == "ts3" ]; then
  9. eulaurl="https://www.teamspeak.com/en/privacy-and-terms"
  10. elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then
  11. eulaurl="https://account.mojang.com/documents/minecraft_eula"
  12. elif [ "${shortname}" == "ut" ]; then
  13. eulaurl="https://www.epicgames.com/unrealtournament/unreal-tournament-pre-alpha-test-development-build-eula"
  14. fi
  15. echo -e ""
  16. echo -e "${bold}${lightyellow}Accept ${gamename} EULA${default}"
  17. echo -e "${bold}=================================${default}"
  18. fn_sleep_time
  19. echo -e "You are required to accept the EULA:"
  20. echo -e ""
  21. echo -e "${italic}${eulaurl}${default}"
  22. echo -e ""
  23. if [ -z "${autoinstall}" ]; then
  24. echo -e "By continuing you are indicating your agreement to the EULA."
  25. echo -e ""
  26. if ! fn_prompt_yn "Continue?" Y; then
  27. exitcode=0
  28. core_exit.sh
  29. fi
  30. elif [ "${commandname}" == "START" ]; then
  31. fn_print_info "By continuing you are indicating your agreement to the EULA."
  32. sleep 5
  33. else
  34. echo -e "By using auto-install you are indicating your agreement to the EULA."
  35. sleep 5
  36. fi
  37. if [ "${shortname}" == "ts3" ]; then
  38. touch "${executabledir}/.ts3server_license_accepted"
  39. elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then
  40. touch "${serverfiles}/eula.txt"
  41. echo -e "eula=true" > "${serverfiles}/eula.txt"
  42. elif [ "${shortname}" == "ut" ]; then
  43. :
  44. fi