check_config.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # LGSM check_config.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. # Description: If server config missing warn user.
  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 2
  17. fi
  18. fi
  19. if [ "${gamename}" == "Rust" ]; then
  20. if [ -z "${rconpassword}" ]; then
  21. fn_print_dots ""
  22. sleep 0.5
  23. fn_print_fail_nl "RCON password is not set!"
  24. echo " * Not setting an RCON password causes issues with ${gamename}"
  25. fn_script_log_fatal "RCON password is not set"
  26. fn_script_log_fatal "Not setting an RCON password causes issues with ${gamename}"
  27. core_exit.sh
  28. elif [ "${rconpassword}" == "CHANGE_ME" ]; then
  29. fn_print_dots ""
  30. sleep 0.5
  31. fn_print_warn_nl "Default RCON Password detected!"
  32. echo " * Having ${rconpassword} as a password is not very safe."
  33. fn_script_log_warn "Default RCON Password detected"
  34. sleep 2
  35. fi
  36. fi