fn_content_gmod 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/bin/bash
  2. # LGSM fn_content_gmod function
  3. # Author: Daniel Gibbs
  4. # E-Mail: me@danielgibbs.co.uk
  5. # Version: 091215
  6. contentdir="${filesdir}/content"
  7. fn_gmod_content_usage(){
  8. echo "Usage: $0 [option]"
  9. echo "${gamename} - Linux Game Server Manager - Version ${version}"
  10. echo "http://gameservermanagers.com/${selfname}"
  11. echo -e ""
  12. echo -e "\e[93mCommands\e[0m"
  13. {
  14. echo -e "\e[34minstall-content-all\t\e[0mStart the server."
  15. echo -e "\e[34minstall-content-css\t\e[0mStart the server."
  16. echo -e "\e[34minstall-content-tf2\t\e[0mStart the server."
  17. } | column -s $'\t' -t
  18. }
  19. fn_content_mode(){
  20. if [ "${gmod-content-mode}" == "all" ]; then
  21. :
  22. elif [ "${gmod-content-mode}" == "css" ]; then
  23. # Counter Strike: Source
  24. appid=232330
  25. filesdir="${contentdir}/css"
  26. elif [ "${gmod-content-mode}" == "tf2" ]; then
  27. # Team Fortress 2
  28. appid=232250
  29. filesdir="${contentdir}/tf2"
  30. elif [ "${gmod-content-mode}" == "3" ]; then
  31. # Half Life 2
  32. appid=220
  33. filesdir="${contentdir}/hl2"
  34. fn_update_check
  35. elif [ "${gmod-content-mode}" == "3" ]; then
  36. # Half LIfe 2: Episode 1
  37. appid=380
  38. filesdir="${contentdir}/hl2ep1"
  39. fn_update_check
  40. elif [ "${gmod-content-mode}" == "4" ]; then
  41. # Half LIfe 2: Episode 2
  42. appid=420
  43. filesdir="${contentdir}/hl2ep2"
  44. fn_update_check
  45. elif [ "${gmod-content-mode}" == "5" ]; then
  46. # Portal
  47. appid=420
  48. filesdir="${contentdir}/portal"
  49. fn_update_check
  50. fi
  51. }
  52. fn_install-content(){
  53. fn_install_serverfiles
  54. fn_install_complete
  55. }
  56. fn_content_update(){
  57. for d in ${contentdir} ; do
  58. if [ "${d}" == "${contentdir}/css"]; then
  59. gmod-content-mode="css"
  60. elif [ "${d}" == "${contentdir}/tf2"]; then
  61. gmod-content-mode="tf2"
  62. fi
  63. fn_install-content
  64. done
  65. }