check_download.sh 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. #!/bin/bash
  2. # Author: Alpha Eva <kaneawk AT gmail.com>
  3. #
  4. # Notes: OneinStack for CentOS/RedHat 7+ Debian 9+ and Ubuntu 16+
  5. #
  6. # Project home page:
  7. # https://oneinstack.com
  8. # https://github.com/oneinstack/oneinstack
  9. checkDownload() {
  10. pushd ${oneinstack_dir}/src > /dev/null
  11. # icu
  12. if ! command -v icu-config >/dev/null 2>&1 || icu-config --version | grep '^3.' || [ "${Ubuntu_ver}" == "20" ]; then
  13. echo "Download icu..."
  14. src_url=${mirror_link}/oneinstack/src/icu4c-${icu4c_ver}-src.tgz && Download_src
  15. fi
  16. # General system utils
  17. if [ "${with_old_openssl_flag}" == 'y' ]; then
  18. echo "Download openSSL..."
  19. src_url=${mirror_link}/oneinstack/src/openssl-${openssl_ver}.tar.gz && Download_src
  20. echo "Download cacert.pem..."
  21. src_url=https://curl.se/ca/cacert.pem && Download_src
  22. fi
  23. # openssl1.1
  24. if [[ ${nginx_option} =~ ^[1-3]$ ]]; then
  25. echo "Download openSSL1.1..."
  26. src_url=${mirror_link}/oneinstack/src/openssl-${openssl11_ver}.tar.gz && Download_src
  27. fi
  28. # jemalloc
  29. if [[ ${nginx_option} =~ ^[1-3]$ ]] || [[ "${db_option}" =~ ^[1-9]$|^1[0-2]$ ]]; then
  30. echo "Download jemalloc..."
  31. src_url=${mirror_link}/oneinstack/src/jemalloc-${jemalloc_ver}.tar.bz2 && Download_src
  32. fi
  33. # pcre
  34. if [[ "${nginx_option}" =~ ^[1-3]$ ]] || [ "${apache_flag}" == 'y' ]; then
  35. echo "Download pcre..."
  36. src_url=${mirror_link}/oneinstack/src/pcre-${pcre_ver}.tar.gz && Download_src
  37. fi
  38. # nginx/tengine/openresty
  39. case "${nginx_option}" in
  40. 1)
  41. echo "Download nginx..."
  42. src_url=${mirror_link}/oneinstack/src/nginx-${nginx_ver}.tar.gz && Download_src
  43. ;;
  44. 2)
  45. echo "Download tengine..."
  46. #src_url=http://tengine.taobao.org/download/tengine-${tengine_ver}.tar.gz && Download_src
  47. src_url=${mirror_link}/oneinstack/src/tengine-${tengine_ver}.tar.gz && Download_src
  48. ;;
  49. 3)
  50. echo "Download openresty..."
  51. src_url=${mirror_link}/oneinstack/src/openresty-${openresty_ver}.tar.gz && Download_src
  52. ;;
  53. esac
  54. # if nginx_option=4 download caddy
  55. if [ "${nginx_option}" == '4' ]; then
  56. echo "Download caddy ${caddy_ver}"
  57. src_url=${mirror_link}/caddy/v${caddy_ver}/caddy-${caddy_ver}.tar.gz && Download_src
  58. fi
  59. # caddy
  60. if [ "${caddy_flag}" == 'y' ]; then
  61. echo "Download caddy ${caddy_ver}"
  62. src_url=${mirror_link}/caddy/v${caddy_ver}/caddy-${caddy_ver}.tar.gz && Download_src
  63. fi
  64. # apache
  65. if [ "${apache_flag}" == 'y' ]; then
  66. echo "Download apache 2.4..."
  67. src_url=http://archive.apache.org/dist/httpd/httpd-${apache_ver}.tar.gz && Download_src
  68. src_url=http://archive.apache.org/dist/apr/apr-${apr_ver}.tar.gz && Download_src
  69. src_url=http://archive.apache.org/dist/apr/apr-util-${apr_util_ver}.tar.gz && Download_src
  70. src_url=${mirror_link}/apache/httpd/nghttp2-${nghttp2_ver}.tar.gz && Download_src
  71. fi
  72. # tomcat
  73. case "${tomcat_option}" in
  74. 1)
  75. echo "Download tomcat 10..."
  76. src_url=${mirror_link}/apache/tomcat/v${tomcat10_ver}/apache-tomcat-${tomcat10_ver}.tar.gz && Download_src
  77. ;;
  78. 2)
  79. echo "Download tomcat 9..."
  80. src_url=${mirror_link}/apache/tomcat/v${tomcat9_ver}/apache-tomcat-${tomcat9_ver}.tar.gz && Download_src
  81. ;;
  82. 3)
  83. echo "Download tomcat 8..."
  84. src_url=${mirror_link}/apache/tomcat/v${tomcat8_ver}/apache-tomcat-${tomcat8_ver}.tar.gz && Download_src
  85. ;;
  86. 4)
  87. echo "Download tomcat 7..."
  88. src_url=${mirror_link}/apache/tomcat/v${tomcat7_ver}/apache-tomcat-${tomcat7_ver}.tar.gz && Download_src
  89. src_url=${mirror_link}/apache/tomcat/v${tomcat7_ver}/catalina-jmx-remote.jar && Download_src
  90. ;;
  91. esac
  92. # jdk apr
  93. if [[ "${jdk_option}" =~ ^[1-2]$ ]]; then
  94. echo "Download apr..."
  95. src_url=http://archive.apache.org/dist/apr/apr-${apr_ver}.tar.gz && Download_src
  96. fi
  97. if [[ "${db_option}" =~ ^[1-9]$|^1[0-4]$ ]]; then
  98. if [[ "${db_option}" =~ ^[1,2,5,6,7,9]$|^10$ ]] && [ "${dbinstallmethod}" == "2" ]; then
  99. [[ "${db_option}" =~ ^[2,5,6,7]$|^10$ ]] && boost_ver=${boost_oldver}
  100. [[ "${db_option}" =~ ^9$ ]] && boost_ver=${boost_percona_ver}
  101. echo "Download boost..."
  102. [ "${OUTIP_STATE}"x == "China"x ] && DOWN_ADDR_BOOST=${mirror_link}/oneinstack/src || DOWN_ADDR_BOOST=https://downloads.sourceforge.net/project/boost/boost/${boost_ver}
  103. boostVersion2=$(echo ${boost_ver} | awk -F. '{print $1"_"$2"_"$3}')
  104. src_url=${DOWN_ADDR_BOOST}/boost_${boostVersion2}.tar.gz && Download_src
  105. fi
  106. case "${db_option}" in
  107. 1)
  108. # MySQL 8.0
  109. if [ "${OUTIP_STATE}"x == "China"x ]; then
  110. DOWN_ADDR_MYSQL=http://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-8.0
  111. DOWN_ADDR_MYSQL_BK=https://mirrors.aliyun.com/mysql/MySQL-8.0
  112. DOWN_ADDR_MYSQL_BK2=http://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-8.0
  113. else
  114. DOWN_ADDR_MYSQL=http://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-8.0
  115. DOWN_ADDR_MYSQL_BK=https://mirrors.dotsrc.org/mysql/Downloads/MySQL-8.0
  116. fi
  117. if [ "${dbinstallmethod}" == '1' ]; then
  118. echo "Download MySQL 8.0 binary package..."
  119. FILE_NAME=mysql-${mysql80_ver}-linux-glibc2.12-x86_64.tar.xz
  120. elif [ "${dbinstallmethod}" == '2' ]; then
  121. echo "Download MySQL 8.0 source package..."
  122. FILE_NAME=mysql-${mysql80_ver}.tar.gz
  123. fi
  124. # start download
  125. src_url=${DOWN_ADDR_MYSQL}/${FILE_NAME} && Download_src
  126. src_url=${DOWN_ADDR_MYSQL}/${FILE_NAME}.md5 && Download_src
  127. # verifying download
  128. MYSQL_TAR_MD5=$(awk '{print $1}' ${FILE_NAME}.md5)
  129. [ -z "${MYSQL_TAR_MD5}" ] && MYSQL_TAR_MD5=$(curl -s ${DOWN_ADDR_MYSQL_BK}/${FILE_NAME}.md5 | grep ${FILE_NAME} | awk '{print $1}')
  130. tryDlCount=0
  131. while [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" != "${MYSQL_TAR_MD5}" ]; do
  132. wget -c --no-check-certificate ${DOWN_ADDR_MYSQL_BK}/${FILE_NAME};sleep 1
  133. let "tryDlCount++"
  134. [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${MYSQL_TAR_MD5}" -o "${tryDlCount}" == '6' ] && break || continue
  135. done
  136. if [ "${tryDlCount}" == '6' ]; then
  137. echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
  138. kill -9 $$; exit 1;
  139. fi
  140. ;;
  141. 2)
  142. # MySQL 5.7
  143. if [ "${OUTIP_STATE}"x == "China"x ]; then
  144. DOWN_ADDR_MYSQL=https://cdn.mysql.com/Downloads/MySQL-5.7
  145. DOWN_ADDR_MYSQL_BK=https://mirrors.aliyun.com/mysql/MySQL-5.7
  146. DOWN_ADDR_MYSQL_BK2=http://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.7
  147. else
  148. DOWN_ADDR_MYSQL=https://cdn.mysql.com/Downloads/MySQL-5.7
  149. DOWN_ADDR_MYSQL_BK=https://mirrors.dotsrc.org/mysql/Downloads/MySQL-5.7
  150. fi
  151. if [ "${dbinstallmethod}" == '1' ]; then
  152. echo "Download MySQL 5.7 binary package..."
  153. FILE_NAME=mysql-${mysql57_ver}-linux-glibc2.12-x86_64.tar.gz
  154. elif [ "${dbinstallmethod}" == '2' ]; then
  155. echo "Download MySQL 5.7 source package..."
  156. FILE_NAME=mysql-${mysql57_ver}.tar.gz
  157. fi
  158. # start download
  159. src_url=${DOWN_ADDR_MYSQL}/${FILE_NAME} && Download_src
  160. src_url=${DOWN_ADDR_MYSQL}/${FILE_NAME}.md5 && Download_src
  161. # verifying download
  162. MYSQL_TAR_MD5=$(awk '{print $1}' ${FILE_NAME}.md5)
  163. [ -z "${MYSQL_TAR_MD5}" ] && MYSQL_TAR_MD5=$(curl -s ${DOWN_ADDR_MYSQL_BK}/${FILE_NAME}.md5 | grep ${FILE_NAME} | awk '{print $1}')
  164. tryDlCount=0
  165. while [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" != "${MYSQL_TAR_MD5}" ]; do
  166. wget -c --no-check-certificate ${DOWN_ADDR_MYSQL_BK}/${FILE_NAME};sleep 1
  167. let "tryDlCount++"
  168. [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${MYSQL_TAR_MD5}" -o "${tryDlCount}" == '6' ] && break || continue
  169. done
  170. if [ "${tryDlCount}" == '6' ]; then
  171. echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
  172. kill -9 $$; exit 1;
  173. fi
  174. ;;
  175. 3)
  176. # MySQL 5.6
  177. if [ "${OUTIP_STATE}"x == "China"x ]; then
  178. DOWN_ADDR_MYSQL=http://mirrors.aliyun.com/mysql/MySQL-5.6
  179. DOWN_ADDR_MYSQL_BK=http://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.6
  180. DOWN_ADDR_MYSQL_BK2=https://mirrors.aliyun.com/mysql/MySQL-5.6
  181. else
  182. DOWN_ADDR_MYSQL=https://cdn.mysql.com/Downloads/MySQL-5.6
  183. DOWN_ADDR_MYSQL_BK=https://mirrors.dotsrc.org/mysql/Downloads/MySQL-5.6
  184. fi
  185. if [ "${dbinstallmethod}" == '1' ]; then
  186. echo "Download MySQL 5.6 binary package..."
  187. FILE_NAME=mysql-${mysql56_ver}-linux-glibc2.12-x86_64.tar.gz
  188. elif [ "${dbinstallmethod}" == '2' ]; then
  189. echo "Download MySQL 5.6 source package..."
  190. FILE_NAME=mysql-${mysql56_ver}.tar.gz
  191. fi
  192. # start download
  193. src_url=${DOWN_ADDR_MYSQL}/${FILE_NAME} && Download_src
  194. src_url=${DOWN_ADDR_MYSQL}/${FILE_NAME}.md5 && Download_src
  195. # verifying download
  196. MYSQL_TAR_MD5=$(awk '{print $1}' ${FILE_NAME}.md5)
  197. [ -z "${MYSQL_TAR_MD5}" ] && MYSQL_TAR_MD5=$(curl -s ${DOWN_ADDR_MYSQL_BK}/${FILE_NAME}.md5 | grep ${FILE_NAME} | awk '{print $1}')
  198. tryDlCount=0
  199. while [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" != "${MYSQL_TAR_MD5}" ]; do
  200. wget -c --no-check-certificate ${DOWN_ADDR_MYSQL_BK}/${FILE_NAME};sleep 1
  201. let "tryDlCount++"
  202. [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${MYSQL_TAR_MD5}" -o "${tryDlCount}" == '6' ] && break || continue
  203. done
  204. if [ "${tryDlCount}" == '6' ]; then
  205. echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
  206. kill -9 $$; exit 1;
  207. fi
  208. ;;
  209. 4)
  210. # MySQL 5.5
  211. if [ "${OUTIP_STATE}"x == "China"x ]; then
  212. DOWN_ADDR_MYSQL=http://mirrors.aliyun.com/mysql/MySQL-5.5
  213. DOWN_ADDR_MYSQL_BK=http://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-5.5
  214. DOWN_ADDR_MYSQL_BK2=https://mirrors.aliyun.com/mysql/MySQL-5.5
  215. else
  216. DOWN_ADDR_MYSQL=https://cdn.mysql.com/Downloads/MySQL-5.5
  217. DOWN_ADDR_MYSQL_BK=https://mirrors.dotsrc.org/mysql/Downloads/MySQL-5.5
  218. fi
  219. if [ "${dbinstallmethod}" == '1' ]; then
  220. echo "Download MySQL 5.5 binary package..."
  221. FILE_NAME=mysql-${mysql55_ver}-linux-glibc2.12-x86_64.tar.gz
  222. elif [ "${dbinstallmethod}" == '2' ]; then
  223. echo "Download MySQL 5.5 source package..."
  224. FILE_NAME=mysql-${mysql55_ver}.tar.gz
  225. src_url=${mirror_link}/oneinstack/src/mysql-5.5-fix-arm-client_plugin.patch && Download_src
  226. fi
  227. # start download
  228. src_url=${DOWN_ADDR_MYSQL}/${FILE_NAME} && Download_src
  229. src_url=${DOWN_ADDR_MYSQL}/${FILE_NAME}.md5 && Download_src
  230. # verifying download
  231. MYSQL_TAR_MD5=$(awk '{print $1}' ${FILE_NAME}.md5)
  232. [ -z "${MYSQL_TAR_MD5}" ] && MYSQL_TAR_MD5=$(curl -s ${DOWN_ADDR_MYSQL_BK}/${FILE_NAME}.md5 | grep ${FILE_NAME} | awk '{print $1}')
  233. tryDlCount=0
  234. while [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" != "${MYSQL_TAR_MD5}" ]; do
  235. wget -c --no-check-certificate ${DOWN_ADDR_MYSQL_BK}/${FILE_NAME};sleep 1
  236. let "tryDlCount++"
  237. [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${MYSQL_TAR_MD5}" -o "${tryDlCount}" == '6' ] && break || continue
  238. done
  239. if [ "${tryDlCount}" == '6' ]; then
  240. echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
  241. kill -9 $$; exit 1;
  242. fi
  243. ;;
  244. [5-8])
  245. case "${db_option}" in
  246. 5)
  247. mariadb_ver=${mariadb1011_ver}
  248. ;;
  249. 6)
  250. mariadb_ver=${mariadb105_ver}
  251. ;;
  252. 7)
  253. mariadb_ver=${mariadb104_ver}
  254. ;;
  255. 8)
  256. mariadb_ver=${mariadb55_ver}
  257. ;;
  258. esac
  259. if [ "${dbinstallmethod}" == '1' ]; then
  260. FILE_NAME=mariadb-${mariadb_ver}-linux-systemd-x86_64.tar.gz
  261. FILE_TYPE=bintar-linux-systemd-x86_64
  262. elif [ "${dbinstallmethod}" == '2' ]; then
  263. FILE_NAME=mariadb-${mariadb_ver}.tar.gz
  264. FILE_TYPE=source
  265. fi
  266. if [ "${OUTIP_STATE}"x == "China"x ]; then
  267. DOWN_ADDR_MARIADB=${mirror_link}/oneinstack/src/mariadb/mariadb-${mariadb_ver}/${FILE_TYPE}
  268. DOWN_ADDR_MARIADB_BK=http://mirrors.ustc.edu.cn/mariadb/mariadb-${mariadb_ver}/${FILE_TYPE}
  269. else
  270. DOWN_ADDR_MARIADB=${mirror_link}/oneinstack/src/mariadb/mariadb-${mariadb_ver}/${FILE_TYPE}
  271. DOWN_ADDR_MARIADB_BK=${mirror_link}/oneinstack/src/mariadb/mariadb-${mariadb_ver}/${FILE_TYPE}
  272. fi
  273. if [ "${db_option}" == '8' ]; then
  274. DOWN_ADDR_MARIADB=https://archive.mariadb.org/mariadb-${mariadb_ver}/${FILE_TYPE}
  275. DOWN_ADDR_MARIADB_BK=${DOWN_ADDR_MARIADB}
  276. fi
  277. echo "Download MariaDB ${FILE_NAME} package..."
  278. src_url=${DOWN_ADDR_MARIADB}/${FILE_NAME} && Download_src
  279. wget --tries=6 -c --no-check-certificate ${DOWN_ADDR_MARIADB}/md5sums.txt -O ${FILE_NAME}.md5
  280. MARAIDB_TAR_MD5=$(awk '{print $1}' ${FILE_NAME}.md5)
  281. [ -z "${MARAIDB_TAR_MD5}" ] && MARAIDB_TAR_MD5=$(curl -s ${DOWN_ADDR_MARIADB_BK}/md5sums.txt | grep ${FILE_NAME} | awk '{print $1}')
  282. tryDlCount=0
  283. while [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" != "${MARAIDB_TAR_MD5}" ]; do
  284. wget -c --no-check-certificate ${DOWN_ADDR_MARIADB_BK}/${FILE_NAME};sleep 1
  285. let "tryDlCount++"
  286. [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${MARAIDB_TAR_MD5}" -o "${tryDlCount}" == '6' ] && break || continue
  287. done
  288. if [ "${tryDlCount}" == '6' ]; then
  289. echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
  290. kill -9 $$; exit 1;
  291. fi
  292. ;;
  293. 9)
  294. # Percona 8.0
  295. if [ "${dbinstallmethod}" == '1' ]; then
  296. echo "Download Percona 8.0 binary package..."
  297. FILE_NAME=Percona-Server-${percona80_ver}-Linux.x86_64.glibc2.28.tar.gz
  298. DOWN_ADDR_PERCONA=https://downloads.percona.com/downloads/Percona-Server-8.0/Percona-Server-${percona80_ver}/binary/tarball
  299. elif [ "${dbinstallmethod}" == '2' ]; then
  300. echo "Download Percona 8.0 source package..."
  301. FILE_NAME=percona-server-${percona80_ver}.tar.gz
  302. if [ "${OUTIP_STATE}"x == "China"x ]; then
  303. DOWN_ADDR_PERCONA=${mirror_link}/oneinstack/src
  304. else
  305. DOWN_ADDR_PERCONA=https://downloads.percona.com/downloads/Percona-Server-8.0/Percona-Server-${percona80_ver}/source/tarball
  306. fi
  307. fi
  308. # start download
  309. src_url=${DOWN_ADDR_PERCONA}/${FILE_NAME} && Download_src
  310. src_url=${mirror_link}/oneinstack/src/${FILE_NAME}.md5sum && Download_src
  311. # verifying download
  312. PERCONA_TAR_MD5=$(awk '{print $1}' ${FILE_NAME}.md5sum)
  313. [ -z "${PERCONA_TAR_MD5}" ] && PERCONA_TAR_MD5=$(curl -s ${mirror_link}/oneinstack/src/${FILE_NAME}.md5sum | grep ${FILE_NAME} | awk '{print $1}')
  314. tryDlCount=0
  315. while [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" != "${PERCONA_TAR_MD5}" ]; do
  316. wget -c --no-check-certificate ${DOWN_ADDR_PERCONA}/${FILE_NAME}; sleep 1
  317. let "tryDlCount++"
  318. [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${PERCONA_TAR_MD5}" -o "${tryDlCount}" == '6' ] && break || continue
  319. done
  320. if [ "${tryDlCount}" == '6' ]; then
  321. echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
  322. kill -9 $$; exit 1;
  323. fi
  324. ;;
  325. 10)
  326. # Precona 5.7
  327. if [ "${dbinstallmethod}" == '1' ]; then
  328. echo "Download Percona 5.7 binary package..."
  329. FILE_NAME=Percona-Server-${percona57_ver}-Linux.x86_64.glibc2.17.tar.gz
  330. DOWN_ADDR_PERCONA=https://downloads.percona.com/downloads/Percona-Server-5.7/Percona-Server-${percona57_ver}/binary/tarball
  331. elif [ "${dbinstallmethod}" == '2' ]; then
  332. echo "Download Percona 5.7 source package..."
  333. FILE_NAME=percona-server-${percona57_ver}.tar.gz
  334. if [ "${OUTIP_STATE}"x == "China"x ]; then
  335. DOWN_ADDR_PERCONA=${mirror_link}/oneinstack/src
  336. else
  337. DOWN_ADDR_PERCONA=https://downloads.percona.com/downloads/Percona-Server-5.7/Percona-Server-${percona57_ver}/source/tarball
  338. fi
  339. fi
  340. # start download
  341. src_url=${DOWN_ADDR_PERCONA}/${FILE_NAME} && Download_src
  342. src_url=${mirror_link}/oneinstack/src/${FILE_NAME}.md5sum && Download_src
  343. # verifying download
  344. PERCONA_TAR_MD5=$(awk '{print $1}' ${FILE_NAME}.md5sum)
  345. [ -z "${PERCONA_TAR_MD5}" ] && PERCONA_TAR_MD5=$(curl -s ${mirror_link}/oneinstack/src/${FILE_NAME}.md5sum | grep ${FILE_NAME} | awk '{print $1}')
  346. tryDlCount=0
  347. while [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" != "${PERCONA_TAR_MD5}" ]; do
  348. wget -c --no-check-certificate ${DOWN_ADDR_PERCONA}/${FILE_NAME}; sleep 1
  349. let "tryDlCount++"
  350. [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${PERCONA_TAR_MD5}" -o "${tryDlCount}" == '6' ] && break || continue
  351. done
  352. if [ "${tryDlCount}" == '6' ]; then
  353. echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
  354. kill -9 $$; exit 1;
  355. fi
  356. ;;
  357. 11)
  358. # Precona 5.6
  359. if [ "${dbinstallmethod}" == '1' ]; then
  360. echo "Download Percona 5.6 binary package..."
  361. perconaVerStr1=$(echo ${percona56_ver} | sed "s@-@-rel@")
  362. FILE_NAME=Percona-Server-${perconaVerStr1}-Linux.x86_64.${sslLibVer}.tar.gz
  363. DOWN_ADDR_PERCONA=https://downloads.percona.com/downloads/Percona-Server-5.6/Percona-Server-${percona56_ver}/binary/tarball
  364. elif [ "${dbinstallmethod}" == '2' ]; then
  365. echo "Download Percona 5.6 source package..."
  366. FILE_NAME=percona-server-${percona56_ver}.tar.gz
  367. if [ "${OUTIP_STATE}"x == "China"x ]; then
  368. DOWN_ADDR_PERCONA=${mirror_link}/oneinstack/src
  369. else
  370. DOWN_ADDR_PERCONA=https://downloads.percona.com/downloads/Percona-Server-5.6/Percona-Server-${percona56_ver}/source/tarball
  371. fi
  372. fi
  373. # start download
  374. src_url=${DOWN_ADDR_PERCONA}/${FILE_NAME} && Download_src
  375. src_url=${mirror_link}/oneinstack/src/${FILE_NAME}.md5sum && Download_src
  376. # verifying download
  377. PERCONA_TAR_MD5=$(awk '{print $1}' ${FILE_NAME}.md5sum)
  378. [ -z "${PERCONA_TAR_MD5}" ] && PERCONA_TAR_MD5=$(curl -s ${mirror_link}/oneinstack/src/${FILE_NAME}.md5sum | grep ${FILE_NAME} | awk '{print $1}')
  379. tryDlCount=0
  380. while [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" != "${PERCONA_TAR_MD5}" ]; do
  381. wget -c --no-check-certificate ${DOWN_ADDR_PERCONA}/${FILE_NAME}; sleep 1
  382. let "tryDlCount++"
  383. [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${PERCONA_TAR_MD5}" -o "${tryDlCount}" == '6' ] && break || continue
  384. done
  385. if [ "${tryDlCount}" == '6' ]; then
  386. echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
  387. kill -9 $$; exit 1;
  388. fi
  389. ;;
  390. 12)
  391. # Percona 5.5
  392. if [ "${dbinstallmethod}" == '1' ]; then
  393. echo "Download Percona 5.5 binary package..."
  394. perconaVerStr1=$(echo ${percona55_ver} | sed "s@-@-rel@")
  395. FILE_NAME=Percona-Server-${perconaVerStr1}-Linux.x86_64.${sslLibVer}.tar.gz
  396. DOWN_ADDR_PERCONA=https://downloads.percona.com/downloads/Percona-Server-5.5/Percona-Server-${percona55_ver}/binary/tarball
  397. elif [ "${dbinstallmethod}" == '2' ]; then
  398. echo "Download Percona 5.5 source package..."
  399. FILE_NAME=percona-server-${percona55_ver}.tar.gz
  400. if [ "${OUTIP_STATE}"x == "China"x ]; then
  401. DOWN_ADDR_PERCONA=${mirror_link}/oneinstack/src
  402. else
  403. DOWN_ADDR_PERCONA=https://downloads.percona.com/downloads/Percona-Server-5.5/Percona-Server-${percona55_ver}/source/tarball
  404. fi
  405. fi
  406. # start download
  407. src_url=${DOWN_ADDR_PERCONA}/${FILE_NAME} && Download_src
  408. src_url=${mirror_link}/oneinstack/src/${FILE_NAME}.md5sum && Download_src
  409. # verifying download
  410. PERCONA_TAR_MD5=$(awk '{print $1}' ${FILE_NAME}.md5sum)
  411. [ -z "${PERCONA_TAR_MD5}" ] && PERCONA_TAR_MD5=$(curl -s ${mirror_link}/oneinstack/src/${FILE_NAME}.md5sum | grep ${FILE_NAME} | awk '{print $1}')
  412. tryDlCount=0
  413. while [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" != "${PERCONA_TAR_MD5}" ]; do
  414. wget -c --no-check-certificate ${DOWN_ADDR_PERCONA}/${FILE_NAME}; sleep 1
  415. let "tryDlCount++"
  416. [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${PERCONA_TAR_MD5}" -o "${tryDlCount}" == '6' ] && break || continue
  417. done
  418. if [ "${tryDlCount}" == '6' ]; then
  419. echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
  420. kill -9 $$; exit 1;
  421. fi
  422. ;;
  423. 13)
  424. FILE_NAME=postgresql-${pgsql_ver}.tar.gz
  425. if [ "${OUTIP_STATE}"x == "China"x ]; then
  426. DOWN_ADDR_PGSQL=https://mirrors.tuna.tsinghua.edu.cn/postgresql/source/v${pgsql_ver}
  427. DOWN_ADDR_PGSQL_BK=https://mirrors.ustc.edu.cn/postgresql/source/v${pgsql_ver}
  428. else
  429. DOWN_ADDR_PGSQL=https://ftp.postgresql.org/pub/source/v${pgsql_ver}
  430. DOWN_ADDR_PGSQL_BK=https://ftp.heanet.ie/mirrors/postgresql/source/v${pgsql_ver}
  431. fi
  432. src_url=${DOWN_ADDR_PGSQL}/${FILE_NAME} && Download_src
  433. src_url=${DOWN_ADDR_PGSQL}/${FILE_NAME}.md5 && Download_src
  434. PGSQL_TAR_MD5=$(awk '{print $1}' ${FILE_NAME}.md5)
  435. [ -z "${PGSQL_TAR_MD5}" ] && PGSQL_TAR_MD5=$(curl -s ${DOWN_ADDR_PGSQL_BK}/${FILE_NAME}.md5 | grep ${FILE_NAME} | awk '{print $1}')
  436. tryDlCount=0
  437. while [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" != "${PGSQL_TAR_MD5}" ]; do
  438. wget -c --no-check-certificate ${DOWN_ADDR_PGSQL_BK}/${FILE_NAME};sleep 1
  439. let "tryDlCount++"
  440. [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${PGSQL_TAR_MD5}" -o "${tryDlCount}" == '6' ] && break || continue
  441. done
  442. if [ "${tryDlCount}" == '6' ]; then
  443. echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
  444. kill -9 $$; exit 1;
  445. fi
  446. ;;
  447. 14)
  448. # MongoDB
  449. echo "Download MongoDB binary package..."
  450. FILE_NAME=mongodb-linux-x86_64-${mongodb_ver}.tgz
  451. if [ "${OUTIP_STATE}"x == "China"x ]; then
  452. DOWN_ADDR_MongoDB=${mirror_link}/oneinstack/src
  453. else
  454. DOWN_ADDR_MongoDB=https://fastdl.mongodb.org/linux
  455. fi
  456. src_url=${DOWN_ADDR_MongoDB}/${FILE_NAME} && Download_src
  457. src_url=${DOWN_ADDR_MongoDB}/${FILE_NAME}.md5 && Download_src
  458. MongoDB_TAR_MD5=$(awk '{print $1}' ${FILE_NAME}.md5)
  459. [ -z "${MongoDB_TAR_MD5}" ] && MongoDB_TAR_MD5=$(curl -s ${DOWN_ADDR_MongoDB}/${FILE_NAME}.md5 | grep ${FILE_NAME} | awk '{print $1}')
  460. tryDlCount=0
  461. while [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" != "${MongoDB_TAR_MD5}" ]; do
  462. wget -c --no-check-certificate ${DOWN_ADDR_MongoDB}/${FILE_NAME};sleep 1
  463. let "tryDlCount++"
  464. [ "$(md5sum ${FILE_NAME} | awk '{print $1}')" == "${MongoDB_TAR_MD5}" -o "${tryDlCount}" == '6' ] && break || continue
  465. done
  466. if [ "${tryDlCount}" == '6' ]; then
  467. echo "${CFAILURE}${FILE_NAME} download failed, Please contact the author! ${CEND}"
  468. kill -9 $$; exit 1;
  469. fi
  470. ;;
  471. esac
  472. fi
  473. # PHP
  474. if [[ "${php_option}" =~ ^[1-9]$|^1[0-3]$ ]] || [[ "${mphp_ver}" =~ ^5[3-6]$|^7[0-4]$|^8[0-3]$ ]]; then
  475. echo "PHP common..."
  476. src_url=${mirror_link}/oneinstack/src/libiconv-${libiconv_ver}.tar.gz && Download_src
  477. src_url=https://curl.haxx.se/download/curl-${curl_ver}.tar.gz && Download_src
  478. src_url=https://downloads.sourceforge.net/project/mhash/mhash/${mhash_ver}/mhash-${mhash_ver}.tar.gz && Download_src
  479. src_url=https://downloads.sourceforge.net/project/mcrypt/Libmcrypt/${libmcrypt_ver}/libmcrypt-${libmcrypt_ver}.tar.gz && Download_src
  480. src_url=https://downloads.sourceforge.net/project/mcrypt/MCrypt/${mcrypt_ver}/mcrypt-${mcrypt_ver}.tar.gz && Download_src
  481. src_url=${mirror_link}/oneinstack/src/freetype-${freetype_ver}.tar.gz && Download_src
  482. fi
  483. if [ "${php_option}" == '1' ] || [ "${mphp_ver}" == '53' ]; then
  484. src_url=${mirror_link}/oneinstack/src/debian_patches_disable_SSLv2_for_openssl_1_0_0.patch && Download_src
  485. src_url=${mirror_link}/oneinstack/src/php5.3patch && Download_src
  486. src_url=https://secure.php.net/distributions/php-${php53_ver}.tar.gz && Download_src
  487. src_url=${mirror_link}/oneinstack/src/fpm-race-condition.patch && Download_src
  488. elif [ "${php_option}" == '2' ] || [ "${mphp_ver}" == '54' ]; then
  489. src_url=https://secure.php.net/distributions/php-${php54_ver}.tar.gz && Download_src
  490. src_url=${mirror_link}/oneinstack/src/fpm-race-condition.patch && Download_src
  491. elif [ "${php_option}" == '3' ] || [ "${mphp_ver}" == '55' ]; then
  492. src_url=https://secure.php.net/distributions/php-${php55_ver}.tar.gz && Download_src
  493. src_url=${mirror_link}/oneinstack/src/fpm-race-condition.patch && Download_src
  494. elif [ "${php_option}" == '4' ] || [ "${mphp_ver}" == '56' ]; then
  495. src_url=https://secure.php.net/distributions/php-${php56_ver}.tar.gz && Download_src
  496. elif [ "${php_option}" == '5' ] || [ "${mphp_ver}" == '70' ]; then
  497. src_url=https://secure.php.net/distributions/php-${php70_ver}.tar.gz && Download_src
  498. elif [ "${php_option}" == '6' ] || [ "${mphp_ver}" == '71' ]; then
  499. src_url=https://secure.php.net/distributions/php-${php71_ver}.tar.gz && Download_src
  500. elif [ "${php_option}" == '7' ] || [ "${mphp_ver}" == '72' ]; then
  501. src_url=${mirror_link}/oneinstack/src/php-${php72_ver}.tar.gz && Download_src
  502. src_url=${mirror_link}/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
  503. src_url=${mirror_link}/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
  504. elif [ "${php_option}" == '8' ] || [ "${mphp_ver}" == '73' ]; then
  505. src_url=${mirror_link}/oneinstack/src/php-${php73_ver}.tar.gz && Download_src
  506. src_url=${mirror_link}/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
  507. src_url=${mirror_link}/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
  508. elif [ "${php_option}" == '9' ] || [ "${mphp_ver}" == '74' ]; then
  509. src_url=${mirror_link}/oneinstack/src/php-${php74_ver}.tar.gz && Download_src
  510. src_url=${mirror_link}/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
  511. src_url=${mirror_link}/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
  512. src_url=${mirror_link}/oneinstack/src/libzip-${libzip_ver}.tar.gz && Download_src
  513. elif [ "${php_option}" == '10' ] || [ "${mphp_ver}" == '80' ]; then
  514. src_url=${mirror_link}/oneinstack/src/php-${php80_ver}.tar.gz && Download_src
  515. src_url=${mirror_link}/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
  516. src_url=${mirror_link}/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
  517. src_url=${mirror_link}/oneinstack/src/libzip-${libzip_ver}.tar.gz && Download_src
  518. elif [ "${php_option}" == '11' ] || [ "${mphp_ver}" == '81' ]; then
  519. src_url=${mirror_link}/oneinstack/src/php-${php81_ver}.tar.gz && Download_src
  520. src_url=${mirror_link}/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
  521. src_url=${mirror_link}/oneinstack/src/libsodium-${libsodium_ver}.tar.gz && Download_src
  522. src_url=${mirror_link}/oneinstack/src/libzip-${libzip_ver}.tar.gz && Download_src
  523. elif [ "${php_option}" == '12' ] || [ "${mphp_ver}" == '82' ]; then
  524. src_url=${mirror_link}/oneinstack/src/php-${php82_ver}.tar.gz && Download_src
  525. src_url=${mirror_link}/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
  526. src_url=${mirror_link}/oneinstack/src/libsodium-${libsodium_up_ver}.tar.gz && Download_src
  527. src_url=${mirror_link}/oneinstack/src/libzip-${libzip_ver}.tar.gz && Download_src
  528. elif [ "${php_option}" == '13' ] || [ "${mphp_ver}" == '83' ]; then
  529. src_url=${mirror_link}/oneinstack/src/php-${php83_ver}.tar.gz && Download_src
  530. src_url=${mirror_link}/oneinstack/src/argon2-${argon2_ver}.tar.gz && Download_src
  531. src_url=${mirror_link}/oneinstack/src/libsodium-${libsodium_up_ver}.tar.gz && Download_src
  532. src_url=${mirror_link}/oneinstack/src/libzip-${libzip_ver}.tar.gz && Download_src
  533. fi
  534. # PHP OPCache
  535. case "${phpcache_option}" in
  536. 1)
  537. if [[ "${php_option}" =~ ^[1-2]$ ]]; then
  538. # php 5.3 5.4
  539. echo "Download Zend OPCache..."
  540. src_url=https://pecl.php.net/get/zendopcache-${zendopcache_ver}.tgz && Download_src
  541. fi
  542. ;;
  543. 2)
  544. echo "Download apcu..."
  545. if [[ "${php_option}" =~ ^[1-4]$ ]]; then
  546. src_url=https://pecl.php.net/get/apcu-${apcu_oldver}.tgz && Download_src
  547. else
  548. src_url=https://pecl.php.net/get/apcu-${apcu_ver}.tgz && Download_src
  549. fi
  550. ;;
  551. 3)
  552. if [[ "${php_option}" =~ ^[1-4]$ ]]; then
  553. # php 5.3 5.4 5.5 5.6
  554. echo "Download xcache..."
  555. src_url=http://xcache.lighttpd.net/pub/Releases/${xcache_ver}/xcache-${xcache_ver}.tar.gz && Download_src
  556. fi
  557. ;;
  558. 4)
  559. # php 5.3 5.4
  560. if [ "${php_option}" == '1' ]; then
  561. echo "Download eaccelerator 0.9..."
  562. src_url=https://github.com/downloads/eaccelerator/eaccelerator/eaccelerator-${eaccelerator_ver}.tar.bz2 && Download_src
  563. elif [ "${php_option}" == '2' ]; then
  564. echo "Download eaccelerator 1.0 dev..."
  565. src_url=https://github.com/eaccelerator/eaccelerator/tarball/master && Download_src
  566. fi
  567. ;;
  568. esac
  569. # Zend Guard Loader
  570. if [ "${pecl_zendguardloader}" == '1' -a "${armplatform}" != 'y' ]; then
  571. case "${php_option}" in
  572. 4)
  573. echo "Download zend loader for php 5.6..."
  574. src_url=${mirror_link}/oneinstack/src/zend-loader-php5.6-linux-x86_64.tar.gz && Download_src
  575. ;;
  576. 3)
  577. echo "Download zend loader for php 5.5..."
  578. src_url=${mirror_link}/oneinstack/src/zend-loader-php5.5-linux-x86_64.tar.gz && Download_src
  579. ;;
  580. 2)
  581. echo "Download zend loader for php 5.4..."
  582. src_url=${mirror_link}/oneinstack/src/ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz && Download_src
  583. ;;
  584. 1)
  585. echo "Download zend loader for php 5.3..."
  586. src_url=${mirror_link}/oneinstack/src/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz && Download_src
  587. ;;
  588. esac
  589. fi
  590. # ioncube
  591. if [ "${pecl_ioncube}" == '1' ]; then
  592. echo "Download ioncube..."
  593. src_url=https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_${SYS_ARCH_i}.tar.gz && Download_src
  594. fi
  595. # SourceGuardian
  596. if [ "${pecl_sourceguardian}" == '1' ]; then
  597. echo "Download SourceGuardian..."
  598. src_url=${mirror_link}/oneinstack/src/loaders.linux-${ARCH}.tar.gz && Download_src
  599. fi
  600. # imageMagick
  601. if [ "${pecl_imagick}" == '1' ]; then
  602. echo "Download ImageMagick..."
  603. src_url=${mirror_link}/oneinstack/src/ImageMagick-${imagemagick_ver}.tar.gz && Download_src
  604. echo "Download imagick..."
  605. if [[ "${php_option}" =~ ^1$ ]]; then
  606. src_url=https://pecl.php.net/get/imagick-${imagick_oldver}.tgz && Download_src
  607. else
  608. src_url=https://pecl.php.net/get/imagick-${imagick_ver}.tgz && Download_src
  609. fi
  610. fi
  611. # graphicsmagick
  612. if [ "${pecl_gmagick}" == '1' ]; then
  613. echo "Download graphicsmagick..."
  614. src_url=https://downloads.sourceforge.net/project/graphicsmagick/graphicsmagick/${graphicsmagick_ver}/GraphicsMagick-${graphicsmagick_ver}.tar.gz && Download_src
  615. if [[ "${php_option}" =~ ^[1-4]$ ]]; then
  616. echo "Download gmagick for php..."
  617. src_url=https://pecl.php.net/get/gmagick-${gmagick_oldver}.tgz && Download_src
  618. else
  619. echo "Download gmagick for php 7.x..."
  620. src_url=https://pecl.php.net/get/gmagick-${gmagick_ver}.tgz && Download_src
  621. fi
  622. fi
  623. # redis-server
  624. if [ "${redis_flag}" == 'y' ]; then
  625. echo "Download redis-server..."
  626. src_url=http://download.redis.io/releases/redis-${redis_ver}.tar.gz && Download_src
  627. fi
  628. # pecl_redis
  629. if [ "${pecl_redis}" == '1' ]; then
  630. if [[ "${php_option}" =~ ^[1-4]$ ]]; then
  631. echo "Download pecl_redis for php 5.x..."
  632. src_url=https://pecl.php.net/get/redis-4.3.0.tgz && Download_src
  633. elif [[ "${php_option}" =~ ^[5-6]$ ]]; then
  634. echo "Download pecl_redis for php 7.0~7.1..."
  635. src_url=https://pecl.php.net/get/redis-5.3.7.tgz && Download_src
  636. else
  637. echo "Download pecl_redis for php 7.2+..."
  638. src_url=https://pecl.php.net/get/redis-${pecl_redis_ver}.tgz && Download_src
  639. fi
  640. fi
  641. # memcached-server
  642. if [ "${memcached_flag}" == 'y' ]; then
  643. echo "Download memcached-server..."
  644. [ "${OUTIP_STATE}"x == "China"x ] && DOWN_ADDR=${mirror_link}/oneinstack/src || DOWN_ADDR=http://www.memcached.org/files
  645. src_url=${DOWN_ADDR}/memcached-${memcached_ver}.tar.gz && Download_src
  646. fi
  647. # pecl_memcached
  648. if [ "${pecl_memcached}" == '1' ]; then
  649. echo "Download libmemcached..."
  650. src_url=https://launchpad.net/libmemcached/1.0/${libmemcached_ver}/+download/libmemcached-${libmemcached_ver}.tar.gz && Download_src
  651. if [[ "${php_option}" =~ ^[1-4]$ ]]; then
  652. echo "Download pecl_memcached for php..."
  653. src_url=https://pecl.php.net/get/memcached-${pecl_memcached_oldver}.tgz && Download_src
  654. else
  655. echo "Download pecl_memcached for php 7.x..."
  656. src_url=https://pecl.php.net/get/memcached-${pecl_memcached_ver}.tgz && Download_src
  657. fi
  658. fi
  659. # memcached-server pecl_memcached pecl_memcache
  660. if [ "${pecl_memcache}" == '1' ]; then
  661. if [[ "${php_option}" =~ ^[1-4]$ ]]; then
  662. echo "Download pecl_memcache for php 5.x..."
  663. src_url=https://pecl.php.net/get/memcache-3.0.8.tgz && Download_src
  664. elif [[ "${php_option}" =~ ^[5-9]$ ]]; then
  665. echo "Download pecl_memcache for php 7.x..."
  666. src_url=https://pecl.php.net/get/memcache-${pecl_memcache_oldver}.tgz && Download_src
  667. else
  668. echo "Download pecl_memcache for php 8.x..."
  669. src_url=https://pecl.php.net/get/memcache-${pecl_memcache_ver}.tgz && Download_src
  670. fi
  671. fi
  672. # pecl_mongodb
  673. if [ "${pecl_mongodb}" == '1' ]; then
  674. echo "Download pecl mongo for php..."
  675. src_url=https://pecl.php.net/get/mongo-${pecl_mongo_ver}.tgz && Download_src
  676. echo "Download pecl mongodb for php..."
  677. src_url=https://pecl.php.net/get/mongodb-${pecl_mongodb_ver}.tgz && Download_src
  678. fi
  679. # nodejs
  680. if [ "${nodejs_flag}" == 'y' ]; then
  681. echo "Download Nodejs..."
  682. [ "${OUTIP_STATE}"x == "China"x ] && DOWN_ADDR_NODE=https://mirrors.tuna.tsinghua.edu.cn/nodejs-release || DOWN_ADDR_NODE=https://nodejs.org/dist
  683. src_url=${DOWN_ADDR_NODE}/v${nodejs_ver}/node-v${nodejs_ver}-linux-${SYS_ARCH_n}.tar.gz && Download_src
  684. fi
  685. # pureftpd
  686. if [ "${pureftpd_flag}" == 'y' ]; then
  687. echo "Download pureftpd..."
  688. src_url=https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-${pureftpd_ver}.tar.gz && Download_src
  689. fi
  690. # phpMyAdmin
  691. if [ "${phpmyadmin_flag}" == 'y' ]; then
  692. echo "Download phpMyAdmin..."
  693. if [[ "${php_option}" =~ ^[1-5]$ ]] || [[ "${mphp_ver}" =~ ^5[3-6]$|^70$ ]]; then
  694. src_url=https://files.phpmyadmin.net/phpMyAdmin/${phpmyadmin_oldver}/phpMyAdmin-${phpmyadmin_oldver}-all-languages.tar.gz && Download_src
  695. else
  696. src_url=https://files.phpmyadmin.net/phpMyAdmin/${phpmyadmin_ver}/phpMyAdmin-${phpmyadmin_ver}-all-languages.tar.gz && Download_src
  697. fi
  698. fi
  699. popd > /dev/null
  700. }