v1.0.0beta18.1

~下载本地根证书功能增加自动检测证书目录逻辑
~现在导入包含高级版规则的配置时,会自动切换到高级版核心
This commit is contained in:
juewuy 2020-12-18 12:58:41 +08:00
parent 7b3e38e4c6
commit fea5673384
2 changed files with 27 additions and 18 deletions

View File

@ -646,29 +646,30 @@ getcrt(){
fi fi
} }
setcrt(){ setcrt(){
crtdir='/etc/ssl/certs/ca-certificates.crt' openssldir=$(openssl version -a 2>&1 | grep OPENSSLDIR | awk -F "\"" '{print $2}')
echo ----------------------------------------------- if [ -n "$openssldir" ];then
echo -e "\033[36m安装/更新本地根证书文件(ca-certificates.crt)\033[0m" crtdir="$openssldir/certs/ca-certificates.crt"
echo -e "\033[33m用于解决证书校验错误x509报错等问题\033[0m" echo -----------------------------------------------
echo -e "\033[31m无上述问题的设备无需使用本功能\033[0m" echo -e "\033[36m安装/更新本地根证书文件(ca-certificates.crt)\033[0m"
[ -f "$crtdir" ] && echo -e "\033[32m当前设备已经安装根证书文件了\033[0m" echo -e "\033[33m用于解决证书校验错误x509报错等问题\033[0m"
echo ----------------------------------------------- echo -e "\033[31m无上述问题的设备无需使用本功能\033[0m"
read -p "确认安装?(1/0) > " res [ -f "$crtdir" ] && echo -e "\033[32m当前设备已经安装根证书文件了\033[0m"
echo -----------------------------------------------
read -p "确认安装?(1/0) > " res
if [ -z "$res" ];then if [ -z "$res" ];then
errornum errornum
elif [ "$res" = '0' ]; then elif [ "$res" = '0' ]; then
i= i=
elif [ "$res" = '1' ]; then elif [ "$res" = '1' ]; then
if [ -d /etc/ssl/certs ];then
getcrt getcrt
else else
echo ----------------------------------------------- errornum
echo -e "\033[33m设备可能未安装openssl或者证书文件目录不是/etc/ssl/certs无法安装\033[0m"
sleep 1
fi fi
else else
errornum echo -----------------------------------------------
echo -e "\033[33m设备可能尚未安装openssl无法安装证书文件\033[0m"
sleep 1
fi fi
} }
setserver(){ setserver(){

View File

@ -185,6 +185,14 @@ EOF`
echo ----------------------------------------------- echo -----------------------------------------------
exit 1 exit 1
fi fi
#检测是否存在高级版规则
if [ "$clashcore" = "clash" -a -n "$(cat $yamlnew | grep -E '^script:|proxy-providers|rule-providers')" ];then
echo -----------------------------------------------
logger "检测到高级版核心专属规则将改为使用premium核心启动" 33
rm -rf $bindir/clash
setconfig clashcore clashpre
echo -----------------------------------------------
fi
#使用核心内置test功能检测 #使用核心内置test功能检测
if [ -x $bindir/clash ];then if [ -x $bindir/clash ];then
$bindir/clash -t -d $bindir -f $yamlnew >/dev/null $bindir/clash -t -d $bindir -f $yamlnew >/dev/null