check_config.sh 1001 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. # LinuxGSM check_config.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://linuxgsm.com
  5. # Description: Checks if the server config is missing and warns the user if needed.
  6. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  7. if [ ! -f "${servercfgfullpath}" ]; then
  8. if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then
  9. fn_print_dots ""
  10. fn_print_warn_nl "Configuration file missing!"
  11. echo -e "${servercfgfullpath}"
  12. fn_script_log_warn "Configuration file missing!"
  13. fn_script_log_warn "${servercfgfullpath}"
  14. install_config.sh
  15. fi
  16. fi
  17. if [ "${shortname}" == "rust" ]; then
  18. if [ -z "${rconpassword}" ]; then
  19. fn_print_dots ""
  20. fn_print_fail_nl "RCON password is not set"
  21. fn_script_log_fatal "RCON password is not set"
  22. core_exit.sh
  23. elif [ "${rconpassword}" == "CHANGE_ME" ]; then
  24. fn_print_dots ""
  25. fn_print_warn_nl "Default RCON Password detected"
  26. fn_script_log_warn "Default RCON Password detected"
  27. fi
  28. fi