check_download.sh 34 KB

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