4
0

update_steamcmd.sh 985 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. # LinuxGSM update_steamcmd.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: http://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Handles updating using SteamCMD.
  7. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. # init steamcmd functions
  9. core_steamcmd.sh
  10. # The location where the builds are checked and downloaded.
  11. remotelocation="SteamCMD"
  12. check.sh
  13. fn_print_dots "${remotelocation}"
  14. if [ "${forceupdate}" == "1" ]; then
  15. # forceupdate bypasses update checks.
  16. if [ "${status}" != "0" ] && [ -v "${status}" ]; then
  17. fn_print_restart_warning
  18. exitbypass=1
  19. command_stop.sh
  20. fn_firstcommand_reset
  21. date '+%s' > "${lockdir:?}/update.lock"
  22. fn_dl_steamcmd
  23. date +%s > "${lockdir}/last-updated.lock"
  24. exitbypass=1
  25. command_start.sh
  26. fn_firstcommand_reset
  27. else
  28. fn_dl_steamcmd
  29. date +%s > "${lockdir}/last-updated.lock"
  30. fi
  31. else
  32. fn_update_steamcmd_localbuild
  33. fn_update_steamcmd_remotebuild
  34. fn_update_steamcmd_compare
  35. fi