install_gslt.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # LinuxGSM install_gslt.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: http://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Configures GSLT.
  7. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. echo -e ""
  9. echo -e "${bold}${lightyellow}Game Server Login Token${default}"
  10. fn_messages_separator
  11. if [ "${shortname}" == "csgo" ] || [ "${shortname}" == "css" ] || [ "${shortname}" == "nmrih" ] || [ "${shortname}" == "bs" ]; then
  12. echo -e "GSLT is required to run a public ${gamename} server"
  13. fn_script_log_info "GSLT is required to run a public ${gamename} server"
  14. else
  15. echo -e "GSLT is an optional feature for ${gamename} server"
  16. fn_script_log_info "GSLT is an optional feature for ${gamename} server"
  17. fi
  18. echo -e "Get more info and a token here:"
  19. echo -e "https://docs.linuxgsm.com/steamcmd/gslt"
  20. fn_script_log_info "Get more info and a token here:"
  21. fn_script_log_info "https://docs.linuxgsm.com/steamcmd/gslt"
  22. echo -e ""
  23. if [ -z "${autoinstall}" ]; then
  24. if [ "${shortname}" != "tu" ]; then
  25. echo -e "Enter token below (Can be blank)."
  26. echo -n "GSLT TOKEN: "
  27. read -r token
  28. if ! grep -q "^gslt=" "${configdirserver}/${selfname}.cfg" > /dev/null 2>&1; then
  29. echo -e "\ngslt=\"${token}\"" >> "${configdirserver}/${selfname}.cfg"
  30. else
  31. sed -i -e "s/gslt=\"[^\"]*\"/gslt=\"${token}\"/g" "${configdirserver}/${selfname}.cfg"
  32. fi
  33. fi
  34. fi
  35. if [ "${shortname}" == "tu" ]; then
  36. echo -e "The GSLT can be changed by editing ${servercfgdir}/${servercfg}."
  37. fn_script_log_info "The GSLT can be changed by editing ${servercfgdir}/${servercfg}."
  38. else
  39. echo -e "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg."
  40. fn_script_log_info "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg."
  41. fi
  42. fn_sleep_time_1
  43. echo -e ""