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

32 lines
939 B

3 years ago
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
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
HTTP_PREFIX="https://"
2 years ago
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
if [ ! -z "$cn" ] || [ "$?" != "0" ] ;then
2 years ago
HTTP_PREFIX="https://ghproxy.com/"
fi
3 years ago
which onig-config
if [ "$?" != "0" ];then
cd ${SOURCE_ROOT}
if [ ! -f ${SOURCE_ROOT}/oniguruma-6.9.4.tar.gz ];then
2 years ago
wget --no-check-certificate -O ${SOURCE_ROOT}/oniguruma-6.9.4.tar.gz ${HTTP_PREFIX}github.com/kkos/oniguruma/archive/v6.9.4.tar.gz
3 years ago
fi
cd ${SOURCE_ROOT} && tar -zxvf oniguruma-6.9.4.tar.gz
cd ${SOURCE_ROOT}/oniguruma-6.9.4 && ./autogen.sh && ./configure --prefix=/usr && make && make install
3 years ago
fi