From fba3ddc9a54ac979d1cf4a313289d437ecce383d Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 5 Aug 2023 16:44:39 +0800 Subject: [PATCH] Update libzip.sh --- plugins/php/lib/libzip.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/php/lib/libzip.sh b/plugins/php/lib/libzip.sh index e68cc3da6..47cc01b36 100644 --- a/plugins/php/lib/libzip.sh +++ b/plugins/php/lib/libzip.sh @@ -13,15 +13,22 @@ rootPath=$(dirname "$rootPath") SERVER_ROOT=$rootPath/lib SOURCE_ROOT=$rootPath/source/lib + +cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +HTTP_PREFIX="https://" +if [ ! -z "$cn" ];then + HTTP_PREFIX="https://ghproxy.com/" +fi + if [ ! -d ${SERVER_ROOT}/libzip ];then cd $SOURCE_ROOT - if [ ! -f ${SOURCE_ROOT}/libzip-1.3.2.tar.gz ];then - wget --no-check-certificate -O libzip-1.3.2.tar.gz --no-check-certificate https://nih.at/libzip/libzip-1.3.2.tar.gz -T 20 + if [ ! -f ${SOURCE_ROOT}/libzip-1.6.1.tar.gz ];then + wget --no-check-certificate -O libzip-1.6.1.tar.gz ${HTTP_PREFIX}github.com/nih-at/libzip/releases/download/rel-1-6-1/libzip-1.6.1.tar.gz -T 20 fi - tar -zxvf libzip-1.3.2.tar.gz - cd libzip-1.3.2 + tar -zxvf libzip-1.6.1.tar.gz + cd libzip-1.6.1 ./configure --prefix=${SERVER_ROOT}/libzip && make && make install