4
0

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. lgsm_version="210516"
  6. # Description: Runs a server validation.
  7. modulename="Validate"
  8. function_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 unbuffer) ]; then
  21. unbuffer=unbuffer
  22. elif [ $(command -v stdbuf) ]; then
  23. unbuffer="stdbuf -i0 -o0 -e0"
  24. fi
  25. if [ "${engine}" == "goldsource" ]; then
  26. ${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}"
  27. else
  28. ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit| tee -a "${scriptlog}"
  29. fi
  30. fix.sh
  31. fn_script_log_info "Checking complete"
  32. }
  33. check_status.sh
  34. if [ "${status}" != "0" ]; then
  35. command_stop.sh
  36. fn_validation
  37. command_start.sh
  38. else
  39. fn_validation
  40. fi