check_download.sh 35 KB

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