command_validate.sh 1.1 KB

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