command_update.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #!/bin/bash
  2. # LinuxGSM command_update.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: https://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Handles updating of servers.
  7. commandname="UPDATE"
  8. commandaction="Updating"
  9. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  10. fn_firstcommand_set
  11. updateexitbypass="${exitbypass}"
  12. fn_print_dots ""
  13. check.sh
  14. core_logs.sh
  15. # A postponed update is requested again if players are still online.
  16. rm -f "${lockdir:?}/${selfname}-update-request.lock"
  17. check_last_update.sh
  18. if [ "${shortname}" == "ts3" ]; then
  19. update_ts3.sh
  20. elif [ "${shortname}" == "mc" ]; then
  21. update_mc.sh
  22. elif [ "${shortname}" == "mcb" ]; then
  23. update_mcb.sh
  24. elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then
  25. update_pmc.sh
  26. elif [ "${shortname}" == "fctr" ]; then
  27. update_fctr.sh
  28. elif [ "${shortname}" == "hyt" ]; then
  29. update_hyt.sh
  30. elif [ "${shortname}" == "mta" ]; then
  31. update_mta.sh
  32. elif [ "${shortname}" == "jk2" ]; then
  33. update_jk2.sh
  34. elif [ "${shortname}" == "jk3" ]; then
  35. update_jk3.sh
  36. elif [ "${shortname}" == "vints" ]; then
  37. update_vints.sh
  38. elif [ "${shortname}" == "bb" ]; then
  39. update_bb.sh
  40. elif [ "${shortname}" == "ut99" ]; then
  41. update_ut99.sh
  42. elif [ "${shortname}" == "xnt" ]; then
  43. update_xnt.sh
  44. elif [ "${shortname}" == "etl" ]; then
  45. update_etl.sh
  46. else
  47. update_steamcmd.sh
  48. fi
  49. if { [ "${shortname}" == "arma3" ] || [ "${shortname}" == "dayz" ] || [ "${shortname}" == "bt" ] || [ "${shortname}" == "col" ] || [ "${shortname}" == "hw" ] || [ "${shortname}" == "l4d2" ] || [ "${shortname}" == "ohd" ] || [ "${shortname}" == "sb" ] || [ "${shortname}" == "squad" ] || [ "${shortname}" == "squad44" ] || [ "${shortname}" == "sol" ] || [ "${shortname}" == "st" ]; } && { [ -n "${workshopmods}" ] || [ -f "${datadir}/${selfname}-workshop.txt" ]; }; then
  50. workshop_core.sh
  51. fn_workshop_update
  52. fi
  53. # remove update lockfile.
  54. rm -f "${lockdir:?}/update.lock"
  55. exitbypass="${updateexitbypass}"
  56. core_exit.sh