check_deps.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #!/bin/bash
  2. # LGSM check_deps.sh function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. # Description: Checks that the require dependencies are installed for LGSM
  6. fn_deps_detector(){
  7. if [ -n "$(command -v dpkg-query)" ]; then
  8. dpkg-query -W -f='${Status}' ${deptocheck} | grep -q -P '^install ok installed$';
  9. depstatus=$?
  10. elif [ -n "$(command -v rpm)" ]; then
  11. rpm -qa ${deptocheck} |grep -q -P ${deptocheck}
  12. depstatus=$?
  13. else
  14. echo "Unknown OS"
  15. fi
  16. }
  17. cd "${executabledir}"
  18. if [ "${executable}" == "./hlds_run" ]; then
  19. local depslist=( lib32gcc1 libstdc++6 libstdc++6:i386 )
  20. for deptocheck in "${depstocheck[@]}"
  21. do
  22. fn_deps_detector
  23. done
  24. # gold source lib32gcc1 libstdc++6 libstdc++6:i386
  25. elif [ "${executable}" == "./srcds_run" ]||[ "${executable}" == "./dabds.sh" ]||[ "${executable}" == "./srcds_run.sh" ]; then
  26. local depslist=( lib32gcc1 libstdc++6 libstdc++6:i386 )
  27. for deptocheck in "${depstocheck[@]}"
  28. do
  29. fn_deps_detector
  30. done
  31. # source lib32gcc1 libstdc++6 libstdc++6:i386
  32. elif [ "${executable}" == "./server_linux32" ]; then
  33. # lib32gcc1 libstdc++6 libstdc++6:i386 speex:i386 libtbb2
  34. elif [ "${executable}" == "./runSam3_DedicatedServer.sh" ]; then
  35. # spark lib32gcc1 libstdc++6 libstdc++6:i386
  36. elif [ "${executable}" == "./7DaysToDie.sh" ]; then
  37. # lib32gcc1 libstdc++6 libstdc++6:i386 telnet expect
  38. elif [ "${executable}" == "./ucc-bin" ]; then
  39. if [ -f "${executabledir}/ucc-bin-real" ]; then
  40. executable=ucc-bin-real
  41. elif [ -f "${executabledir}/ut2004-bin" ]; then
  42. executable=ut2004-bin
  43. else
  44. executable=ut-bin
  45. fi
  46. elif [ "${executable}" == "./ts3server_startscript.sh" ]; then
  47. executable=ts3server_linux_amd64
  48. fi