Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/plugins/php/lib/zlib.sh

43 lines
1.3 KiB

3 years ago
#!/bin/bash
2 years ago
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin
3 years ago
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
rootPath=$(dirname "$rootPath")
# echo $rootPath
SERVER_ROOT=$rootPath/lib
SOURCE_ROOT=$rootPath/source/lib
2 years ago
mkdir -p $SOURCE_ROOT
2 years ago
HTTP_PREFIX="https://"
2 years ago
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
2 years ago
if [ ! -z "$cn" ] || [ "$?" == "0" ] ;then
2 years ago
HTTP_PREFIX="https://ghproxy.com/"
fi
2 years ago
# HTTP_PREFIX="https://"
2 years ago
3 years ago
if [ ! -d ${SERVER_ROOT}/zlib ];then
3 years ago
cd $SOURCE_ROOT
if [ ! -f ${SOURCE_ROOT}/zlib-1.2.11.tar.gz ];then
2 years ago
echo "wget --no-check-certificate -O ${SOURCE_ROOT}/zlib-1.2.11.tar.gz ${HTTP_PREFIX}github.com/madler/zlib/archive/v1.2.11.tar.gz -T 20"
wget --no-check-certificate -O ${SOURCE_ROOT}/zlib-1.2.11.tar.gz ${HTTP_PREFIX}github.com/madler/zlib/archive/v1.2.11.tar.gz -T 20
3 years ago
fi
2 years ago
if [ ! -d ${SOURCE_ROOT}/zlib-1.2.11 ];then
cd $SOURCE_ROOT && tar -zxvf zlib-1.2.11.tar.gz
fi
cd ${SOURCE_ROOT}/zlib-1.2.11
3 years ago
./configure --prefix=${SERVER_ROOT}/zlib && make && make install
2 years ago
cd $SOURCE_ROOT && rm -rf $SOURCE_ROOT/zlib-1.2.11
3 years ago
#rm -rf zlib-1.2.11
#rm -rf zlib-1.2.11.tar.gz
fi