fn_validate 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. # LGSM fn_validate function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. # Version: 050515
  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}"
  21. cd "steamcmd"
  22. if [ $(command -v unbuffer) ]; then
  23. unbuffer=unbuffer
  24. fi
  25. ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}"
  26. fn_scriptlog "Checking complete"
  27. }
  28. fn_check_root
  29. fn_check_systemdir
  30. tmuxwc=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -v failed|grep -Ec "^${servicename}:")
  31. if [ "${tmuxwc}" -eq 1 ]; then
  32. fn_stop
  33. fn_validation
  34. fn_start
  35. else
  36. fn_validation
  37. fi