command_validate.sh 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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_dots "Checking server files"
  15. sleep 1
  16. fn_print_ok "Checking server files"
  17. fn_script_log_info "Checking server files"
  18. sleep 1
  19. cd "${rootdir}/steamcmd"
  20. if [ $(command -v stdbuf) ]; then
  21. unbuffer="stdbuf -i0 -o0 -e0"
  22. fi
  23. if [ "${engine}" == "goldsource" ]; then
  24. ${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}"
  25. else
  26. ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit| tee -a "${scriptlog}"
  27. fi
  28. fix.sh
  29. fn_script_log_info "Checking complete"
  30. }
  31. check_status.sh
  32. if [ "${status}" != "0" ]; then
  33. exitbypass=1
  34. command_stop.sh
  35. fn_validation
  36. exitbypass=1
  37. command_start.sh
  38. else
  39. fn_validation
  40. fi
  41. core_exit.sh