check_config.sh 932 B

1234567891011121314151617181920212223242526
  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 [ -n "${servercfgfullpath}" ]&&[ ! -f "${servercfgfullpath}" ]; then
  8. fn_print_dots ""
  9. fn_print_warn_nl "Configuration file missing!"
  10. echo -e "${servercfgfullpath}"
  11. fn_script_log_warn "Configuration file missing!"
  12. fn_script_log_warn "${servercfgfullpath}"
  13. install_config.sh
  14. fi
  15. if [ "${shortname}" == "rust" ]&&[ -v rconpassword ]&&[ -z "${rconpassword}" ]; then
  16. fn_print_dots ""
  17. fn_print_fail_nl "RCON password is not set"
  18. fn_script_log_warn "RCON password is not set"
  19. elif [ -v rconpassword ]&&[ "${rconpassword}" == "CHANGE_ME" ]; then
  20. fn_print_dots ""
  21. fn_print_warn_nl "Default RCON Password detected"
  22. fn_script_log_warn "Default RCON Password detected"
  23. fi