command_validate.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. local 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_scriptlog "Checking server files"
  18. sleep 1
  19. cd "${rootdir}/steamcmd"
  20. if [ $(command -v unbuffer) ]; then
  21. unbuffer=unbuffer
  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_scriptlog "Checking complete"
  30. }
  31. check_status.sh
  32. if [ "${status}" != "0" ]; then
  33. command_stop.sh
  34. fn_validation
  35. command_start.sh
  36. else
  37. fn_validation
  38. fi