check_deps.sh 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  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_warning_nl "Missing dependencies: ${red}${array_deps_missing[@]}${default}"
  176. fn_script_log_warn "Missing dependencies: ${array_deps_missing[@]}"
  177. sleep 0.5
  178. if [ -n "${monostatus}" ]; then
  179. fn_install_mono_repo
  180. fi
  181. if [ -n "${jqstatus}" ]; then
  182. fn_print_warning_nl "jq is not available in the ${distroname} repository"
  183. echo " * https://github.com/GameServerManagers/LinuxGSM/wiki/jq"
  184. fi
  185. sudo -v > /dev/null 2>&1
  186. if [ $? -eq 0 ]; then
  187. fn_print_information_nl "Automatically installing missing dependencies."
  188. fn_script_log_info "Automatically installing missing dependencies."
  189. echo -en ".\r"
  190. sleep 1
  191. echo -en "..\r"
  192. sleep 1
  193. echo -en "...\r"
  194. sleep 1
  195. echo -en " \r"
  196. if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  197. cmd="sudo dpkg --add-architecture i386; sudo apt update; sudo apt -y install ${array_deps_missing[@]}"
  198. eval "${cmd}"
  199. elif [ -n "$(command -v dnf 2>/dev/null)" ]; then
  200. cmd="sudo dnf -y install ${array_deps_missing[@]}"
  201. eval "${cmd}"
  202. elif [ -n "$(command -v yum 2>/dev/null)" ]; then
  203. cmd="sudo yum -y install ${array_deps_missing[@]}"
  204. eval "${cmd}"
  205. fi
  206. if [ $? != 0 ]; then
  207. fn_print_failure_nl "Unable to install dependencies"
  208. fn_script_log_fatal "Unable to install dependencies"
  209. echo ""
  210. fn_print_warning_nl "Manually install dependencies."
  211. fn_script_log_warn "Manually install dependencies."
  212. if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  213. echo " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}"
  214. elif [ -n "$(command -v dnf 2>/dev/null)" ]; then
  215. echo " sudo dnf install ${array_deps_missing[@]}"
  216. elif [ -n "$(command -v yum 2>/dev/null)" ]; then
  217. echo " sudo yum install ${array_deps_missing[@]}"
  218. fi
  219. if [ "${steamcmdfail}" ]; then
  220. echo ""
  221. fn_print_failure_nl "Missing dependencies required to run SteamCMD."
  222. fn_script_log_fatal "Missing dependencies required to run SteamCMD."
  223. core_exit.sh
  224. fi
  225. else
  226. fn_print_complete_nl "Install dependencies completed"
  227. fn_script_log_pass "Install dependencies completed"
  228. fi
  229. else
  230. echo ""
  231. fn_print_warning_nl "$(whoami) does not have sudo access. Manually install dependencies."
  232. fn_script_log_warn "$(whoami) does not have sudo access. Manually install dependencies."
  233. if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
  234. echo " sudo dpkg --add-architecture i386; sudo apt update; sudo apt install ${array_deps_missing[@]}"
  235. elif [ -n "$(command -v dnf 2>/dev/null)" ]; then
  236. echo " sudo dnf install ${array_deps_missing[@]}"
  237. elif [ -n "$(command -v yum 2>/dev/null)" ]; then
  238. echo " sudo yum install ${array_deps_missing[@]}"
  239. fi
  240. if [ "${steamcmdfail}" ]; then
  241. echo ""
  242. fn_print_failure_nl "Missing dependencies required to run SteamCMD."
  243. fn_script_log_fatal "Missing dependencies required to run SteamCMD."
  244. core_exit.sh
  245. fi
  246. echo ""
  247. fi
  248. if [ "${function_selfname}" == "command_install.sh" ]; then
  249. sleep 5
  250. fi
  251. else
  252. if [ "${function_selfname}" == "command_install.sh" ]; then
  253. fn_print_information_nl "Required dependencies already installed"
  254. fn_script_log_info "Required dependencies already installed"
  255. fi
  256. fi
  257. }
  258. fn_check_loop(){
  259. # Loop though required depenencies
  260. for deptocheck in "${array_deps_required[@]}"
  261. do
  262. fn_deps_detector
  263. done
  264. # user to be informed of any missing dependencies
  265. fn_found_missing_deps
  266. }
  267. # Generate require dependencies for debian based systems
  268. fn_deps_build_debian(){
  269. # Generate array of missing deps
  270. array_deps_missing=()
  271. ## LinuxGSM requirements
  272. array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python bzip2 gzip unzip binutils bc jq )
  273. # All servers except ts3 require tmux
  274. if [ "${shortname}" != "ts3" ]; then
  275. if [ "$(command -v tmux 2>/dev/null)" ]; then
  276. tmuxcheck=1 # Added for users compiling tmux from source to bypass check.
  277. else
  278. array_deps_required+=( tmux )
  279. fi
  280. fi
  281. # All servers except ts3, mumble, GTA and minecraft servers require libstdc++6 and lib32gcc1
  282. if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${engine}" != "renderware" ]; then
  283. if [ "${arch}" == "x86_64" ]; then
  284. array_deps_required+=( lib32gcc1 libstdc++6:i386 )
  285. else
  286. array_deps_required+=( libstdc++6:i386 )
  287. fi
  288. fi
  289. ## Game Specific requirements
  290. # Natural Selection 2 - x64 only
  291. if [ "${shortname}" == "ns2" ]; then
  292. array_deps_required+=( speex libtbb2 )
  293. # NS2: Combat
  294. elif [ "${shortname}" == "ns2c" ]; then
  295. array_deps_required+=( speex:i386 libtbb2 )
  296. # 7 Days to Die
  297. elif [ "${shortname}" == "sdtd" ]; then
  298. array_deps_required+=( telnet expect )
  299. # No More Room in Hell, Counter-Strike: Source and Garry's Mod
  300. elif [ "${shortname}" == "nmrih" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "zps" ]; then
  301. if [ "${arch}" == "x86_64" ]; then
  302. array_deps_required+=( lib32tinfo5 )
  303. else
  304. array_deps_required+=( libtinfo5 )
  305. fi
  306. # Brainbread 2 ,Don't Starve Together & Team Fortress 2
  307. elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then
  308. array_deps_required+=( libcurl4-gnutls-dev:i386 )
  309. if [ "${shortname}" == "tf2" ]; then
  310. array_deps_required+=( libtcmalloc-minimal4:i386 )
  311. fi
  312. # Battlefield: 1942
  313. elif [ "${shortname}" == "bf1942" ]; then
  314. array_deps_required+=( libncurses5:i386 )
  315. # Call of Duty
  316. elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]; then
  317. array_deps_required+=( libstdc++5:i386 )
  318. # Factorio
  319. elif [ "${shortname}" == "fctr" ]; then
  320. array_deps_required+=( xz-utils )
  321. # Hurtword/Rust
  322. elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then
  323. array_deps_required+=( lib32z1 )
  324. # Minecraft
  325. elif [ "${shortname}" == "mc" ]; then
  326. javaversion=$(java -version 2>&1 | grep "version")
  327. if [ "${javaversion}" ]; then
  328. javacheck=1 # Added for users using Oracle JRE to bypass the check.
  329. else
  330. array_deps_required+=( openjdk-8-jre-headless )
  331. fi
  332. # Project Zomboid
  333. elif [ "${shortname}" == "pz" ]; then
  334. if [ -n "$(java -version 2>&1 | grep "version")" ]; then
  335. javacheck=1 # Added for users using Oracle JRE to bypass the check.
  336. array_deps_required+=( rng-tools )
  337. else
  338. array_deps_required+=( default-jre rng-tools )
  339. fi
  340. # GoldenEye: Source
  341. elif [ "${shortname}" == "ges" ]; then
  342. array_deps_required+=( zlib1g:i386 libldap-2.4-2:i386 )
  343. # Serious Sam 3: BFE
  344. elif [ "${shortname}" == "ss3" ]; then
  345. 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 )
  346. # Sven Co-op
  347. elif [ "${shortname}" == "sven" ]; then
  348. array_deps_required+=( libssl1.0.0:i386 )
  349. # Unreal Engine
  350. elif [ "${executable}" == "./ucc-bin" ]; then
  351. #UT2K4
  352. if [ -f "${executabledir}/ut2004-bin" ]; then
  353. array_deps_required+=( libsdl1.2debian libstdc++5:i386 )
  354. #UT99
  355. else
  356. array_deps_required+=( libsdl1.2debian )
  357. fi
  358. # Unreal Tournament
  359. elif [ "${shortname}" == "ut" ]; then
  360. array_deps_required+=( unzip )
  361. # Eco
  362. elif [ "${shortname}" == "eco" ]; then
  363. array_deps_required+=( mono-complete )
  364. # Wurm: Unlimited
  365. elif [ "${shortname}" == "wurm" ]; then
  366. array_deps_required+=( xvfb )
  367. fi
  368. fn_deps_email
  369. fn_check_loop
  370. }
  371. fn_deps_build_redhat(){
  372. # Generate array of missing deps
  373. array_deps_missing=()
  374. # LinuxGSM requirements
  375. ## CentOS 6
  376. if [ "${distroversion}" == "6" ]; then
  377. array_deps_required=( curl wget util-linux-ng python file gzip bzip2 unzip binutils bc jq )
  378. elif [ "${distroid}" == "fedora" ]; then
  379. array_deps_required=( curl wget util-linux python2 file gzip bzip2 unzip binutils bc jq )
  380. elif [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then
  381. array_deps_required=( curl wget util-linux python27 file gzip bzip2 unzip binutils bc jq )
  382. else
  383. array_deps_required=( curl wget util-linux python file gzip bzip2 unzip binutils bc jq )
  384. fi
  385. # All servers except ts3 require tmux
  386. if [ "${shortname}" != "ts3" ]; then
  387. if [ "$(command -v tmux 2>/dev/null)" ]; then
  388. tmuxcheck=1 # Added for users compiling tmux from source to bypass check.
  389. else
  390. array_deps_required+=( tmux )
  391. fi
  392. fi
  393. # All servers except ts3,mumble,multitheftauto and minecraft servers require glibc.i686 and libstdc++.i686
  394. if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${engine}" != "renderware" ]; then
  395. if [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then
  396. array_deps_required+=( glibc.i686 libstdc++64.i686 )
  397. else
  398. array_deps_required+=( glibc.i686 libstdc++.i686 )
  399. fi
  400. fi
  401. # Game Specific requirements
  402. # Natural Selection 2 (x64 only)
  403. if [ "${shortname}" == "ns2" ]; then
  404. array_deps_required+=( speex tbb )
  405. # NS2: Combat
  406. elif [ "${shortname}" == "ns2c" ]; then
  407. array_deps_required+=( speex.i686 tbb.i686 )
  408. # 7 Days to Die
  409. elif [ "${shortname}" == "sdtd" ]; then
  410. array_deps_required+=( telnet expect )
  411. # No More Room in Hell, Counter-Strike: Source, Garry's Mod and Zombie Panic: Source
  412. elif [ "${shortname}" == "nmrih" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "zps" ]; then
  413. array_deps_required+=( ncurses-libs.i686 )
  414. # Brainbread 2, Don't Starve Together & Team Fortress 2
  415. elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then
  416. array_deps_required+=( libcurl.i686 )
  417. if [ "${gamename}" == "Team Fortress 2" ]; then
  418. array_deps_required+=( gperftools-libs.i686 )
  419. fi
  420. # Battlefield: 1942
  421. elif [ "${shortname}" == "bf1942" ]; then
  422. array_deps_required+=( ncurses-libs.i686 )
  423. # Call of Duty
  424. elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]; then
  425. array_deps_required+=( compat-libstdc++-33.i686 )
  426. # Factorio
  427. elif [ "${shortname}" == "fctr" ]; then
  428. array_deps_required+=( xz )
  429. elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then
  430. array_deps_required+=( zlib-devel )
  431. # Minecraft
  432. elif [ "${shortname}" == "mc" ]; 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. # Project Zomboid & Minecraft
  441. elif [ "${shortname}" == "pz" ]; then
  442. javaversion=$(java -version 2>&1 | grep "version")
  443. if [ "${javaversion}" ]; then
  444. javacheck=1 # Added for users using Oracle JRE to bypass the check.
  445. array_deps_required+=( rng-tools )
  446. else
  447. array_deps_required+=( java-1.8.0-openjdk rng-tools )
  448. fi
  449. # GoldenEye: Source
  450. elif [ "${shortname}" == "ges" ]; then
  451. array_deps_required+=( zlib.i686 openldap.i686 )
  452. # Unreal Engine
  453. elif [ "${executable}" == "./ucc-bin" ]; then
  454. #UT2K4
  455. if [ -f "${executabledir}/ut2004-bin" ]; then
  456. array_deps_required+=( compat-libstdc++-33.i686 SDL.i686 bzip2 )
  457. #UT99
  458. else
  459. array_deps_required+=( SDL.i686 bzip2 )
  460. fi
  461. # Unreal Tournament
  462. elif [ "${shortname}" == "ut" ]; then
  463. array_deps_required+=( unzip )
  464. # Eco
  465. elif [ "${shortname}" == "eco" ]; then
  466. array_deps_required+=( mono-complete )
  467. fi
  468. fn_deps_email
  469. fn_check_loop
  470. }
  471. if [ "${function_selfname}" == "command_install.sh" ]; then
  472. if [ "$(whoami)" == "root" ]; then
  473. echo ""
  474. echo "Checking Dependencies as root"
  475. echo "================================="
  476. fn_print_information_nl "Checking any missing dependencies for ${gamename} server only."
  477. fn_print_information_nl "This will NOT install a ${gamename} server."
  478. sleep 2
  479. else
  480. echo ""
  481. echo "Checking Dependencies"
  482. echo "================================="
  483. fi
  484. fi
  485. # Filter checking in to Debian or Red Hat Based
  486. info_distro.sh
  487. if [ -f "/etc/debian_version" ]; then
  488. fn_deps_build_debian
  489. elif [ -f "/etc/redhat-release" ]; then
  490. fn_deps_build_redhat
  491. else
  492. fn_print_warning_nl "${distroname} dependency checking unavailable"
  493. fi