install_gslt.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. # LinuxGSM install_gslt.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. # Description: Configures GSLT.
  6. local commandname="INSTALL"
  7. local commandaction="Install"
  8. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  9. echo ""
  10. echo "Game Server Login Token"
  11. echo "================================="
  12. sleep 1
  13. if [ "${gamename}" == "Counter-Strike: Global Offensive" ]||[ "${gamename}" == "Counter-Strike: Source" ]; then
  14. echo "GSLT is required to run a public ${gamename} server"
  15. fn_script_log_info "GSLT is required to run a public ${gamename} server"
  16. else
  17. echo "GSLT is an optional feature for ${gamename} server"
  18. fn_script_log_info "GSLT is an optional feature for ${gamename} server"
  19. fi
  20. echo "Get more info and a token here:"
  21. echo "https://gameservermanagers.com/gslt"
  22. fn_script_log_info "Get more info and a token here:"
  23. fn_script_log_info "https://gameservermanagers.com/gslt"
  24. echo ""
  25. if [ -z "${autoinstall}" ]; then
  26. if [ "${gamename}" != "Tower Unite" ]; then
  27. echo "Enter token below (Can be blank)."
  28. echo -n "GSLT TOKEN: "
  29. read token
  30. sed -i -e "s/gslt=\"\"/gslt=\"${token}\"/g" "${rootdir}/${selfname}"
  31. fi
  32. fi
  33. sleep 1
  34. if [ "${gamename}" == "Tower Unite" ]; then
  35. echo "The GSLT can be changed by editing ${servercfg}."
  36. fn_script_log_info "The GSLT can be changed by editing ${servercfg}."
  37. else
  38. echo "The GSLT can be changed by editing ${selfname}."
  39. fn_script_log_info "The GSLT can be changed by editing ${selfname}."
  40. fi
  41. echo ""