command_validate.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. commandname="VALIDATE"
  7. commandaction="Validating"
  8. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  9. fn_firstcommand_set
  10. fn_validate(){
  11. fn_print_warn "Validate might overwrite some customised files"
  12. fn_script_log_warn "${commandaction} server: Validate might overwrite some customised files"
  13. totalseconds=3
  14. for seconds in {3..1}; do
  15. fn_print_warn "Validate might overwrite some customised files: ${totalseconds}"
  16. totalseconds=$((totalseconds - 1))
  17. sleep 1
  18. if [ "${seconds}" == "0" ]; then
  19. break
  20. fi
  21. done
  22. fn_print_warn_nl "Validate might overwrite some customised files"
  23. fn_dl_steamcmd
  24. }
  25. # The location where the builds are checked and downloaded.
  26. remotelocation="SteamCMD"
  27. check.sh
  28. fn_print_dots "${remotelocation}"
  29. if [ "${status}" != "0" ]; then
  30. fn_print_restart_warning
  31. exitbypass=1
  32. command_stop.sh
  33. fn_firstcommand_reset
  34. fn_validate
  35. exitbypass=1
  36. command_start.sh
  37. fn_firstcommand_reset
  38. else
  39. fn_validate
  40. fi
  41. core_exit.sh