check_config.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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_warn_nl "RCON password not set!"
  24. echo "This would lead to unexpected behavior. Aborting."
  25. fn_script_log_warn "No RCON Password set, exitting!"
  26. exit 1
  27. elif [ "${rconpassword}" == "CHANGE_ME" ]; then
  28. fn_print_dots ""
  29. sleep 0.5
  30. fn_print_warn_nl "Default RCON Password detected!"
  31. echo "Having CHANGE_ME as a passowrd is not very safe."
  32. fn_script_log_warn "RCON Password is the default one!"
  33. sleep 2
  34. fi
  35. fi