fn_validate 950 B

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