command_validate.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. fn_validation(){
  9. fn_printwarn "Validating may overwrite some customised files."
  10. sleep 1
  11. echo -en "\n"
  12. echo -en "https://developer.valvesoftware.com/wiki/SteamCMD#Validate"
  13. sleep 5
  14. echo -en "\n"
  15. fn_printdots "Checking server files"
  16. sleep 1
  17. fn_printok "Checking server files"
  18. fn_scriptlog "Checking server files"
  19. sleep 1
  20. cd "${rootdir}/steamcmd"
  21. if [ $(command -v unbuffer) ]; then
  22. unbuffer=unbuffer
  23. fi
  24. if [ "${engine}" == "goldsource" ]; then
  25. ${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}"
  26. else
  27. ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}"
  28. fi
  29. if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then
  30. echo -e '\n'
  31. fix_csgo.sh
  32. fi
  33. fn_scriptlog "Checking complete"
  34. }
  35. check.sh
  36. tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
  37. if [ "${tmuxwc}" -eq 1 ]; then
  38. command_stop.sh
  39. fn_validation
  40. command_start.sh
  41. else
  42. fn_validation
  43. fi