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/openssl_10.sh

51 lines
1.6 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")
2 years ago
opensslVersion="1.0.2q"
3 years ago
# echo $rootPath
SERVER_ROOT=$rootPath/lib
SOURCE_ROOT=$rootPath/source/lib
2 years ago
HTTP_PREFIX="https://"
2 years ago
LOCAL_ADDR=common
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
LOCAL_ADDR=cn
2 years ago
HTTP_PREFIX="https://ghproxy.com/"
fi
3 years ago
if [ ! -d ${SERVER_ROOT}/openssl10 ];then
cd ${SOURCE_ROOT}
2 years ago
if [ "$LOCAL_ADDR" == 'cn' ];then
if [ ! -f ${SOURCE_ROOT}/openssl-${opensslVersion}.tar.gz ];then
wget --no-check-certificate -O openssl-${opensslVersion}.tar.gz https://dl.midoks.icu/lib/openssl-${opensslVersion}.tar.gz -T 20
2 years ago
fi
fi
# if [ ! -f ${SOURCE_ROOT}/openssl-${opensslVersion}.tar.gz ];then
# wget --no-check-certificate ${HTTP_PREFIX}/midoks/mdserver-web/releases/download/init/openssl-${opensslVersion}.tar.gz -T 20
# fi
2 years ago
if [ ! -f ${SOURCE_ROOT}/openssl-${opensslVersion}.tar.gz ];then
2 years ago
wget --no-check-certificate -O openssl-${opensslVersion}.tar.gz https://github.com/midoks/mdserver-web/releases/download/init/openssl-${opensslVersion}.tar.gz -T 20
fi
2 years ago
tar -zxf openssl-${opensslVersion}.tar.gz
cd openssl-${opensslVersion}
3 years ago
./config --openssldir=${SERVER_ROOT}/openssl10 zlib-dynamic shared
make && make install
2 years ago
cd $SOURCE_ROOT && rm -rf $SOURCE_ROOT/openssl-${opensslVersion}
3 years ago
fi