command_validate.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #!/bin/bash
  2. # LGSM command_validate.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. # Description: Runs a server validation.
  6. local commandnane="VALIDATE"
  7. local commandaction="Validate"
  8. local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  9. fn_validation(){
  10. fn_print_warn_nl "Validating may overwrite some customised files."
  11. echo -en "https://developer.valvesoftware.com/wiki/SteamCMD#Validate"
  12. sleep 5
  13. echo -en "\n"
  14. fn_print_ok "Checking server files"
  15. fn_script_log_info "Checking server files"
  16. sleep 1
  17. cd "${rootdir}/steamcmd"
  18. if [ $(command -v stdbuf) ]; then
  19. unbuffer="stdbuf -i0 -o0 -e0"
  20. fi
  21. if [ "${engine}" == "goldsource" ]; then
  22. ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_set_config 90 mod ${appidmod} +app_update "${appid}" +app_update "${appid}" validate +quit| tee -a "${scriptlog}"
  23. else
  24. ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit| tee -a "${scriptlog}"
  25. fi
  26. fix.sh
  27. fn_script_log_info "Checking complete"
  28. }
  29. fn_print_dots "Checking server files"
  30. sleep 1
  31. check.sh
  32. check_status.sh
  33. if [ "${status}" != "0" ]; then
  34. exitbypass=1
  35. command_stop.sh
  36. fn_validation
  37. exitbypass=1
  38. command_start.sh
  39. else
  40. fn_validation
  41. fi
  42. core_exit.sh