command_validate.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # LGSM command_validate.sh function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. lgsm_version="271215"
  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.sh
  32. tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
  33. if [ "${tmuxwc}" -eq 1 ]; then
  34. command_stop.sh
  35. fn_validation
  36. command_start.sh
  37. else
  38. fn_validation
  39. fi