command_validate.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #!/bin/bash
  2. # LinuxGSM command_validate.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://linuxgsm.com
  5. # Description: Runs a server validation.
  6. fn_commandname(){
  7. commandname="VALIDATE"
  8. commandaction="Validating"
  9. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  10. }
  11. fn_commandname
  12. fn_validate(){
  13. fn_print_warn "Validate might overwrite some customised files"
  14. fn_script_log_warn "${commandaction} server: Validate might overwrite some customised files"
  15. totalseconds=3
  16. for seconds in {3..1}; do
  17. fn_print_warn "Validate might overwrite some customised files: ${totalseconds}"
  18. totalseconds=$((totalseconds - 1))
  19. sleep 1
  20. if [ "${seconds}" == "0" ]; then
  21. break
  22. fi
  23. done
  24. fn_print_warn_nl "Validate might overwrite some customised files"
  25. fn_dl_steamcmd
  26. }
  27. # The location where the builds are checked and downloaded.
  28. remotelocation="SteamCMD"
  29. check.sh
  30. fn_print_dots "${remotelocation}"
  31. if [ "${status}" != "0" ]; then
  32. fn_print_restart_warning
  33. exitbypass=1
  34. command_stop.sh
  35. fn_commandname
  36. fn_validate
  37. exitbypass=1
  38. command_start.sh
  39. fn_commandname
  40. else
  41. fn_validate
  42. fi
  43. core_exit.sh