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 "${lightyellow}Game Server Login Token${default}"
  10. echo -e "================================="
  11. fn_sleep_time
  12. if [ "${shortname}" == "csgo" ] || [ "${shortname}" == "css" ] || [ "${shortname}" == "nmrih" ] || [ "${shortname}" == "bs" ]; then
  13. echo -e "GSLT is required to run a public ${gamename} server"
  14. fn_script_log_info "GSLT is required to run a public ${gamename} server"
  15. else
  16. echo -e "GSLT is an optional feature for ${gamename} server"
  17. fn_script_log_info "GSLT is an optional feature for ${gamename} server"
  18. fi
  19. echo -e "Get more info and a token here:"
  20. echo -e "https://docs.linuxgsm.com/steamcmd/gslt"
  21. fn_script_log_info "Get more info and a token here:"
  22. fn_script_log_info "https://docs.linuxgsm.com/steamcmd/gslt"
  23. echo -e ""
  24. if [ -z "${autoinstall}" ]; then
  25. if [ "${shortname}" != "tu" ]; then
  26. echo -e "Enter token below (Can be blank)."
  27. echo -n "GSLT TOKEN: "
  28. read -r token
  29. if ! grep -q "^gslt=" "${configdirserver}/${selfname}.cfg" > /dev/null 2>&1; then
  30. echo -e "\ngslt=\"${token}\"" >> "${configdirserver}/${selfname}.cfg"
  31. else
  32. sed -i -e "s/gslt=\"[^\"]*\"/gslt=\"${token}\"/g" "${configdirserver}/${selfname}.cfg"
  33. fi
  34. fi
  35. fi
  36. fn_sleep_time
  37. if [ "${shortname}" == "tu" ]; then
  38. echo -e "The GSLT can be changed by editing ${servercfgdir}/${servercfg}."
  39. fn_script_log_info "The GSLT can be changed by editing ${servercfgdir}/${servercfg}."
  40. else
  41. echo -e "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg."
  42. fn_script_log_info "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg."
  43. fi
  44. echo -e ""