check_deps.sh 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498
  1. #!/bin/bash
  2. # LinuxGSM check_deps.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://linuxgsm.com
  5. # Description: Checks if required dependencies are installed for LinuxGSM.
  6. local commandname="CHECK"
  7. fn_install_mono_repo(){
  8. if [ "${monostatus}" != "0" ]; then
  9. fn_print_dots "Adding Mono repository"
  10. sleep 0.5
  11. sudo -v > /dev/null 2>&1
  12. if [ $? -eq 0 ]; then
  13. fn_print_info_nl "Automatically adding Mono repository."
  14. fn_script_log_info "Automatically adding Mono repository."
  15. echo -en ".\r"
  16. sleep 1
  17. echo -en "..\r"
  18. sleep 1
  19. echo -en "...\r"
  20. sleep 1
  21. echo -en " \r"
  22. if [ "${distroid}" == "ubuntu" ]; then
  23. if [ "${distroversion}" == "18.04" ]; then
  24. cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  25. eval ${cmd}
  26. elif [ "${distroversion}" == "16.04" ]; then
  27. cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https;echo 'deb https://download.mono-project.com/repo/ubuntu stable-xenial main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  28. eval ${cmd}
  29. elif [ "${distroversion}" == "14.04" ]; then
  30. cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https;echo 'deb https://download.mono-project.com/repo/ubuntu stable-trusty main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  31. eval ${cmd}
  32. else
  33. fn_print_warn_nl "Installing Mono repository"
  34. echo "Mono auto install not available for ${distroname}"
  35. echo " Follow instructions on mono site to install the latest version of Mono."
  36. echo " https://www.mono-project.com/download/stable/#download-lin"
  37. monoautoinstall="1"
  38. fi
  39. elif [ "${distroid}" == "debian" ]; then
  40. if [ "${distroversion}" == "9" ]; then
  41. cmd="sudo apt install apt-transport-https dirmngr;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-stretch main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  42. eval ${cmd}
  43. elif [ "${distroversion}" == "8" ]; then
  44. cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https;echo 'deb https://download.mono-project.com/repo/debian stable-jessie main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update"
  45. eval ${cmd}
  46. else
  47. echo "Mono auto install not available for ${distroname}"
  48. echo " Follow instructions on mono site to install the latest version of Mono."
  49. echo " https://www.mono-project.com/download/stable/#download-lin"
  50. monoautoinstall="1"
  51. fi
  52. elif [ "${distroid}" == "centos" ]; then
  53. if [ "${distroversion}" == "7" ]; then
  54. cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'"
  55. eval ${cmd}
  56. elif [ "${distroversion}" == "6" ]; then
  57. cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos6-stable.repo | tee /etc/yum.repos.d/mono-centos6-stable.repo'"
  58. eval ${cmd}
  59. else
  60. echo "Mono auto install not available for ${distroname}"
  61. echo " Follow instructions on mono site to install the latest version of Mono."
  62. echo " https://www.mono-project.com/download/stable/#download-lin"
  63. monoautoinstall="1"
  64. fi
  65. elif [ "${distroid}" == "fedora" ]; then
  66. cmd="rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF'; su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'; dnf update"
  67. eval ${cmd}
  68. else
  69. echo "Mono auto install not available for ${distroname}"
  70. echo " Follow instructions on mono site to install the latest version of Mono."
  71. echo " https://www.mono-project.com/download/stable/#download-lin"
  72. monoautoinstall="1"
  73. fi
  74. if [ "${monoautoinstall}" != "1" ];then
  75. if [ $? != 0 ]; then
  76. fn_print_failure_nl "Unable to install Mono repository."
  77. fn_script_log_fatal "Unable to installMono repository."
  78. monoautoinstall=1
  79. else
  80. fn_print_complete_nl "Installing Mono repository completed."
  81. fn_script_log_pass "Installing Mono repository completed."
  82. monoautoinstall=0
  83. fi
  84. fi
  85. else
  86. fn_print_information_nl "Installing Mono repository"
  87. echo ""
  88. fn_print_warning_nl "$(whoami) does not have sudo access. Manually install Mono repository."
  89. fn_script_log_warn "$(whoami) does not have sudo access. Manually install Mono repository."
  90. echo " Follow instructions on mono site to install the latest version of Mono."
  91. echo " https://www.mono-project.com/download/stable/#download-lin"
  92. fi
  93. fi
  94. }
  95. fn_deps_detector(){
  96. # Checks if dependency is missing
  97. if [ "${tmuxcheck}" == "1" ]; then
  98. # Added for users compiling tmux from source to bypass check.
  99. depstatus=0
  100. deptocheck="tmux"
  101. unset tmuxcheck
  102. elif [ "${javacheck}" == "1" ]; then
  103. # Added for users using Oracle JRE to bypass check.
  104. depstatus=0
  105. deptocheck="${javaversion}"
  106. unset javacheck
  107. elif [ "${deptocheck}" == "jq" ]&&[ "${distroversion}" == "6" ]; then
  108. jqstatus=1
  109. elif [ "${deptocheck}" == "mono-complete" ]; then
  110. if [ "$(command -v mono 2>/dev/null)" ]&&[ "$(mono --version 2>&1 | grep -Po '(?<=version )\d')" -ge 5 ]; then
  111. # Mono >= 5.0.0 already installed
  112. depstatus=0
  113. else
  114. # Mono not installed or installed Mono < 5.0.0
  115. depstatus=1
  116. monostatus=1
  117. fi
  118. elif [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  119. dpkg-query -W -f='${Status}' "${deptocheck}" 2>/dev/null | grep -q -P '^install ok installed'
  120. depstatus=$?
  121. elif [ -n "$(command -v rpm 2>/dev/null)" ]; then
  122. rpm -q "${deptocheck}" > /dev/null 2>&1
  123. depstatus=$?
  124. fi
  125. if [ "${depstatus}" == "0" ]; then
  126. # if dependency is found
  127. missingdep=0
  128. if [ "${function_selfname}" == "command_install.sh" ]; then
  129. echo -e "${green}${deptocheck}${default}"
  130. sleep 0.2
  131. fi
  132. else
  133. # if dependency is not found
  134. missingdep=1
  135. if [ "${function_selfname}" == "command_install.sh" ]; then
  136. echo -e "${red}${deptocheck}${default}"
  137. sleep 0.2
  138. fi
  139. # Define required dependencies for SteamCMD
  140. if [ -n "${appid}" ]; then
  141. if [ "${deptocheck}" == "glibc.i686" ]||[ "${deptocheck}" == "libstdc++64.i686" ]||[ "${deptocheck}" == "lib32gcc1" ]||[ "${deptocheck}" == "libstdc++6:i386" ]; then
  142. steamcmdfail=1
  143. fi
  144. fi
  145. fi
  146. # Missing dependencies are added to array_deps_missing
  147. if [ "${missingdep}" == "1" ]; then
  148. array_deps_missing+=("${deptocheck}")
  149. fi
  150. }
  151. fn_deps_email(){
  152. # Adds postfix to required dependencies if email alert is enabled
  153. if [ "${emailalert}" == "on" ]; then
  154. if [ -f /usr/bin/mailx ]; then
  155. if [ -d /etc/exim4 ]; then
  156. array_deps_required+=( exim4 )
  157. elif [ -d /etc/sendmail ]; then
  158. array_deps_required+=( sendmail )
  159. elif [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  160. array_deps_required+=( mailutils postfix )
  161. elif [ -n "$(command -v rpm 2>/dev/null)" ]; then
  162. array_deps_required+=( mailx postfix )
  163. fi
  164. else
  165. if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  166. array_deps_required+=( mailutils postfix )
  167. elif [ -n "$(command -v rpm 2>/dev/null)" ]; then
  168. array_deps_required+=( mailx postfix )
  169. fi
  170. fi
  171. fi
  172. }
  173. fn_found_missing_deps(){
  174. if [ "${#array_deps_missing[@]}" != "0" ]; then
  175. fn_print_dots "Checking dependencies"
  176. sleep 0.5
  177. fn_print_error_nl "Checking dependencies: missing: ${red}${array_deps_missing[@]}${default}"
  178. fn_script_log_error "Checking dependencies: missing: ${array_deps_missing[@]}"
  179. sleep 0.5
  180. if [ -n "${monostatus}" ]; then
  181. fn_install_mono_repo
  182. fi
  183. if [ -n "${jqstatus}" ]; then
  184. fn_print_warning_nl "jq is not available in the ${distroname} repository"
  185. echo " * https://github.com/GameServerManagers/LinuxGSM/wiki/jq"
  186. fi
  187. sudo -v > /dev/null 2>&1
  188. if [ $? -eq 0 ]; then
  189. fn_print_information_nl "Automatically installing missing dependencies."
  190. fn_script_log_info "Automatically installing missing dependencies."
  191. echo -en ".\r"
  192. sleep 1
  193. echo -en "..\r"
  194. sleep 1
  195. echo -en "...\r"
  196. sleep 1
  197. echo -en " \r"
  198. if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  199. cmd="sudo dpkg --add-architecture i386; sudo apt update; sudo apt -y install ${array_deps_missing[@]}"
  200. eval "${cmd}"
  201. elif [ -n "$(command -v dnf 2>/dev/null)" ]; then
  202. cmd="sudo dnf -y install ${array_deps_missing[@]}"
  203. eval "${cmd}"
  204. elif [ -n "$(command -v yum 2>/dev/null)" ]; then
  205. cmd="sudo yum -y install ${array_deps_missing[@]}"
  206. eval "${cmd}"
  207. fi
  208. if [ $? != 0 ]; then
  209. fn_print_failure_nl "Unable to install dependencies"
  210. fn_script_log_fatal "Unable to install dependencies"
  211. echo ""
  212. fn_print_warning_nl "Manually install dependencies."
  213. fn_script_log_warn "Manually install dependencies."
  214. if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  215. echo " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}"
  216. elif [ -n "$(command -v dnf 2>/dev/null)" ]; then
  217. echo " sudo dnf install ${array_deps_missing[@]}"
  218. elif [ -n "$(command -v yum 2>/dev/null)" ]; then
  219. echo " sudo yum install ${array_deps_missing[@]}"
  220. fi
  221. if [ "${steamcmdfail}" ]; then
  222. echo ""
  223. fn_print_failure_nl "Missing dependencies required to run SteamCMD."
  224. fn_script_log_fatal "Missing dependencies required to run SteamCMD."
  225. core_exit.sh
  226. fi
  227. else
  228. fn_print_complete_nl "Install dependencies completed"
  229. fn_script_log_pass "Install dependencies completed"
  230. fi
  231. else
  232. echo ""
  233. fn_print_warning_nl "$(whoami) does not have sudo access. Manually install dependencies."
  234. fn_script_log_warn "$(whoami) does not have sudo access. Manually install dependencies."
  235. if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  236. echo " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}"
  237. elif [ -n "$(command -v dnf 2>/dev/null)" ]; then
  238. echo " sudo dnf install ${array_deps_missing[@]}"
  239. elif [ -n "$(command -v yum 2>/dev/null)" ]; then
  240. echo " sudo yum install ${array_deps_missing[@]}"
  241. fi
  242. if [ "${steamcmdfail}" ]; then
  243. echo ""
  244. fn_print_failure_nl "Missing dependencies required to run SteamCMD."
  245. fn_script_log_fatal "Missing dependencies required to run SteamCMD."
  246. core_exit.sh
  247. fi
  248. echo ""
  249. fi
  250. if [ "${function_selfname}" == "command_install.sh" ]; then
  251. sleep 5
  252. fi
  253. fi
  254. }
  255. fn_check_loop(){
  256. # Loop though required depenencies
  257. for deptocheck in "${array_deps_required[@]}"
  258. do
  259. fn_deps_detector
  260. done
  261. # user to be informed of any missing dependencies
  262. fn_found_missing_deps
  263. }
  264. # Generate require dependencies for debian based systems
  265. fn_deps_build_debian(){
  266. # Generate array of missing deps
  267. array_deps_missing=()
  268. ## LinuxGSM requirements
  269. array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python bzip2 gzip unzip binutils bc jq )
  270. # All servers except ts3 require tmux
  271. if [ "${shortname}" != "ts3" ]; then
  272. if [ "$(command -v tmux 2>/dev/null)" ]; then
  273. tmuxcheck=1 # Added for users compiling tmux from source to bypass check.
  274. else
  275. array_deps_required+=( tmux )
  276. fi
  277. fi
  278. # All servers except ts3, mumble, GTA and minecraft servers require libstdc++6 and lib32gcc1
  279. if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${engine}" != "renderware" ]; then
  280. if [ "${arch}" == "x86_64" ]; then
  281. array_deps_required+=( lib32gcc1 libstdc++6:i386 )
  282. else
  283. array_deps_required+=( libstdc++6:i386 )
  284. fi
  285. fi
  286. ## Game Specific requirements
  287. # Natural Selection 2 - x64 only
  288. if [ "${shortname}" == "ns2" ]; then
  289. array_deps_required+=( speex libtbb2 )
  290. # NS2: Combat
  291. elif [ "${shortname}" == "ns2c" ]; then
  292. array_deps_required+=( speex:i386 libtbb2 )
  293. # 7 Days to Die
  294. elif [ "${shortname}" == "sdtd" ]; then
  295. array_deps_required+=( telnet expect )
  296. # No More Room in Hell, Counter-Strike: Source and Garry's Mod
  297. elif [ "${shortname}" == "nmrih" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "zps" ]; then
  298. if [ "${arch}" == "x86_64" ]; then
  299. array_deps_required+=( lib32tinfo5 )
  300. else
  301. array_deps_required+=( libtinfo5 )
  302. fi
  303. # Brainbread 2 ,Don't Starve Together & Team Fortress 2
  304. elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then
  305. array_deps_required+=( libcurl4-gnutls-dev:i386 )
  306. if [ "${shortname}" == "tf2" ]; then
  307. array_deps_required+=( libtcmalloc-minimal4:i386 )
  308. fi
  309. # Battlefield: 1942
  310. elif [ "${shortname}" == "bf1942" ]; then
  311. array_deps_required+=( libncurses5:i386 )
  312. # Call of Duty
  313. elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]; then
  314. array_deps_required+=( libstdc++5:i386 )
  315. # Factorio
  316. elif [ "${shortname}" == "fctr" ]; then
  317. array_deps_required+=( xz-utils )
  318. # Hurtword/Rust
  319. elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then
  320. array_deps_required+=( lib32z1 )
  321. # Minecraft
  322. elif [ "${shortname}" == "mc" ]; then
  323. javaversion=$(java -version 2>&1 | grep "version")
  324. if [ "${javaversion}" ]; then
  325. javacheck=1 # Added for users using Oracle JRE to bypass the check.
  326. else
  327. array_deps_required+=( openjdk-8-jre-headless )
  328. fi
  329. # Project Zomboid
  330. elif [ "${shortname}" == "pz" ]; then
  331. if [ -n "$(java -version 2>&1 | grep "version")" ]; then
  332. javacheck=1 # Added for users using Oracle JRE to bypass the check.
  333. array_deps_required+=( rng-tools )
  334. else
  335. array_deps_required+=( default-jre rng-tools )
  336. fi
  337. # GoldenEye: Source
  338. elif [ "${shortname}" == "ges" ]; then
  339. array_deps_required+=( zlib1g:i386 libldap-2.4-2:i386 )
  340. # Serious Sam 3: BFE
  341. elif [ "${shortname}" == "ss3" ]; then
  342. array_deps_required+=( libxrandr2:i386 libglu1-mesa:i386 libxtst6:i386 libusb-1.0-0-dev:i386 libxxf86vm1:i386 libopenal1:i386 libssl1.0.0:i386 libgtk2.0-0:i386 libdbus-glib-1-2:i386 libnm-glib-dev:i386 )
  343. # Unreal Engine
  344. elif [ "${executable}" == "./ucc-bin" ]; then
  345. #UT2K4
  346. if [ -f "${executabledir}/ut2004-bin" ]; then
  347. array_deps_required+=( libsdl1.2debian libstdc++5:i386 )
  348. #UT99
  349. else
  350. array_deps_required+=( libsdl1.2debian )
  351. fi
  352. # Unreal Tournament
  353. elif [ "${shortname}" == "ut" ]; then
  354. array_deps_required+=( unzip )
  355. # Eco
  356. elif [ "${shortname}" == "eco" ]; then
  357. array_deps_required+=( mono-complete )
  358. fi
  359. fn_deps_email
  360. fn_check_loop
  361. }
  362. fn_deps_build_redhat(){
  363. # Generate array of missing deps
  364. array_deps_missing=()
  365. # LinuxGSM requirements
  366. ## CentOS 6
  367. if [ "${distroversion}" == "6" ]; then
  368. array_deps_required=( curl wget util-linux-ng python file gzip bzip2 unzip binutils bc jq )
  369. elif [ "${distroid}" == "fedora" ]; then
  370. array_deps_required=( curl wget util-linux python2 file gzip bzip2 unzip binutils bc jq )
  371. elif [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then
  372. array_deps_required=( curl wget util-linux python27 file gzip bzip2 unzip binutils bc jq )
  373. else
  374. array_deps_required=( curl wget util-linux python file gzip bzip2 unzip binutils bc jq )
  375. fi
  376. # All servers except ts3 require tmux
  377. if [ "${shortname}" != "ts3" ]; then
  378. if [ "$(command -v tmux 2>/dev/null)" ]; then
  379. tmuxcheck=1 # Added for users compiling tmux from source to bypass check.
  380. else
  381. array_deps_required+=( tmux )
  382. fi
  383. fi
  384. # All servers except ts3,mumble,multitheftauto and minecraft servers require glibc.i686 and libstdc++.i686
  385. if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${engine}" != "renderware" ]; then
  386. if [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then
  387. array_deps_required+=( glibc.i686 libstdc++64.i686 )
  388. else
  389. array_deps_required+=( glibc.i686 libstdc++.i686 )
  390. fi
  391. fi
  392. # Game Specific requirements
  393. # Natural Selection 2 (x64 only)
  394. if [ "${shortname}" == "ns2" ]; then
  395. array_deps_required+=( speex tbb )
  396. # NS2: Combat
  397. elif [ "${shortname}" == "ns2c" ]; then
  398. array_deps_required+=( speex.i686 tbb.i686 )
  399. # 7 Days to Die
  400. elif [ "${shortname}" == "sdtd" ]; then
  401. array_deps_required+=( telnet expect )
  402. # No More Room in Hell, Counter-Strike: Source, Garry's Mod and Zombie Panic: Source
  403. elif [ "${shortname}" == "nmrih" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "zps" ]; then
  404. array_deps_required+=( ncurses-libs.i686 )
  405. # Brainbread 2, Don't Starve Together & Team Fortress 2
  406. elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then
  407. array_deps_required+=( libcurl.i686 )
  408. if [ "${gamename}" == "Team Fortress 2" ]; then
  409. array_deps_required+=( gperftools-libs.i686 )
  410. fi
  411. # Battlefield: 1942
  412. elif [ "${shortname}" == "bf1942" ]; then
  413. array_deps_required+=( ncurses-libs.i686 )
  414. # Call of Duty
  415. elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]; then
  416. array_deps_required+=( compat-libstdc++-33.i686 )
  417. # Factorio
  418. elif [ "${shortname}" == "fctr" ]; then
  419. array_deps_required+=( xz )
  420. elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then
  421. array_deps_required+=( zlib-devel )
  422. # Minecraft
  423. elif [ "${shortname}" == "mc" ]; then
  424. javaversion=$(java -version 2>&1 | grep "version")
  425. if [ "${javaversion}" ]; then
  426. javacheck=1 # Added for users using Oracle JRE to bypass the check.
  427. array_deps_required+=( rng-tools )
  428. else
  429. array_deps_required+=( java-1.8.0-openjdk rng-tools )
  430. fi
  431. # Project Zomboid & Minecraft
  432. elif [ "${shortname}" == "pz" ]; then
  433. javaversion=$(java -version 2>&1 | grep "version")
  434. if [ "${javaversion}" ]; then
  435. javacheck=1 # Added for users using Oracle JRE to bypass the check.
  436. array_deps_required+=( rng-tools )
  437. else
  438. array_deps_required+=( java-1.8.0-openjdk rng-tools )
  439. fi
  440. # GoldenEye: Source
  441. elif [ "${shortname}" == "ges" ]; then
  442. array_deps_required+=( zlib.i686 openldap.i686 )
  443. # Unreal Engine
  444. elif [ "${executable}" == "./ucc-bin" ]; then
  445. #UT2K4
  446. if [ -f "${executabledir}/ut2004-bin" ]; then
  447. array_deps_required+=( compat-libstdc++-33.i686 SDL.i686 bzip2 )
  448. #UT99
  449. else
  450. array_deps_required+=( SDL.i686 bzip2 )
  451. fi
  452. # Unreal Tournament
  453. elif [ "${shortname}" == "ut" ]; then
  454. array_deps_required+=( unzip )
  455. # Eco
  456. elif [ "${shortname}" == "eco" ]; then
  457. array_deps_required+=( mono-complete )
  458. fi
  459. fn_deps_email
  460. fn_check_loop
  461. }
  462. if [ "${function_selfname}" == "command_install.sh" ]; then
  463. echo ""
  464. echo "Checking Dependencies"
  465. echo "================================="
  466. fi
  467. # Filter checking in to Debian or Red Hat Based
  468. info_distro.sh
  469. if [ -f "/etc/debian_version" ]; then
  470. fn_deps_build_debian
  471. elif [ -f "/etc/redhat-release" ]; then
  472. fn_deps_build_redhat
  473. else
  474. fn_print_warning_nl "${distroname} dependency checking unavailable"
  475. fi