check_config.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  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. echo -e " * Not setting an RCON password causes issues with ${gamename}"
  22. fn_script_log_fatal "RCON password is not set"
  23. fn_script_log_fatal "Not setting an RCON password causes issues with ${gamename}"
  24. core_exit.sh
  25. elif [ "${rconpassword}" == "CHANGE_ME" ]; then
  26. fn_print_dots ""
  27. fn_print_warn_nl "Default RCON Password detected!"
  28. echo -e " * Having ${rconpassword} as a password is not very safe."
  29. fn_script_log_warn "Default RCON Password detected"
  30. fi
  31. fi