check_config.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. # LGSM check_config.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. # Description: Checks if the server config is missing and warns the user if needed.
  6. local commandname="CHECK"
  7. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  8. if [ ! -e "${servercfgfullpath}" ]; then
  9. if [ "${gamename}" != "Hurtworld" ]; then
  10. fn_print_dots ""
  11. sleep 0.5
  12. fn_print_warn_nl "Configuration file missing!"
  13. echo "${servercfgfullpath}"
  14. fn_script_log_warn "Configuration file missing!"
  15. fn_script_log_warn "${servercfgfullpath}"
  16. sleep 1
  17. install_config.sh
  18. fi
  19. fi
  20. if [ "${gamename}" == "Rust" ]; then
  21. if [ -z "${rconpassword}" ]; then
  22. fn_print_dots ""
  23. sleep 0.5
  24. fn_print_fail_nl "RCON password is not set!"
  25. echo " * Not setting an RCON password causes issues with ${gamename}"
  26. fn_script_log_fatal "RCON password is not set"
  27. fn_script_log_fatal "Not setting an RCON password causes issues with ${gamename}"
  28. core_exit.sh
  29. elif [ "${rconpassword}" == "CHANGE_ME" ]; then
  30. fn_print_dots ""
  31. sleep 0.5
  32. fn_print_warn_nl "Default RCON Password detected!"
  33. echo " * Having ${rconpassword} as a password is not very safe."
  34. fn_script_log_warn "Default RCON Password detected"
  35. sleep 2
  36. fi
  37. fi