command_validate.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 modulename="Validate"
  7. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  8. fn_validation(){
  9. fn_print_warn_nl "Validating may overwrite some customised files."
  10. echo -en "https://developer.valvesoftware.com/wiki/SteamCMD#Validate"
  11. sleep 5
  12. echo -en "\n"
  13. fn_print_dots "Checking server files"
  14. sleep 1
  15. fn_print_ok "Checking server files"
  16. fn_script_log_info "Checking server files"
  17. sleep 1
  18. cd "${rootdir}/steamcmd"
  19. if [ $(command -v stdbuf) ]; then
  20. unbuffer="stdbuf -i0 -o0 -e0"
  21. fi
  22. if [ "${engine}" == "goldsource" ]; then
  23. ${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}"
  24. else
  25. ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit| tee -a "${scriptlog}"
  26. fi
  27. fix.sh
  28. fn_script_log_info "Checking complete"
  29. }
  30. check_status.sh
  31. if [ "${status}" != "0" ]; then
  32. exitbypass=1
  33. command_stop.sh
  34. fn_validation
  35. exitbypass=1
  36. command_start.sh
  37. else
  38. fn_validation
  39. fi
  40. core_exit.sh