mirror of
https://github.com/juewuy/ShellCrash.git
synced 2024-11-16 19:55:57 +08:00
v1.0.0beta16.4
~增加mac过滤白名单功能 ~屏蔽不使用本地dns功能,如有需求可在dns配置中自行编辑 ~屏蔽使用自定义配置功能,现在可以手动将自定义设置写入user.yaml、自定义规则写入rules.yaml,运行时会自动合并配置文件 ~修复设置http代理加密后导致更新检测失败的bug ~修复添加3个以上dns时添加失败的bug
This commit is contained in:
parent
6949df4e3d
commit
9687748b85
|
@ -244,14 +244,14 @@ setdns(){
|
||||||
clashadv
|
clashadv
|
||||||
elif [ "$num" = 1 ]; then
|
elif [ "$num" = 1 ]; then
|
||||||
read -p "请输入新的DNS > " dns_nameserver
|
read -p "请输入新的DNS > " dns_nameserver
|
||||||
dns_nameserver=$(echo $dns_nameserver | sed 's/|/\,\ /')
|
dns_nameserver=$(echo $dns_nameserver | sed 's/|/\,\ /g')
|
||||||
if [ -n "$dns_nameserver" ]; then
|
if [ -n "$dns_nameserver" ]; then
|
||||||
setconfig dns_nameserver \'$dns_nameserver\'
|
setconfig dns_nameserver \'$dns_nameserver\'
|
||||||
echo -e "\033[32m设置成功!!!\033[0m"
|
echo -e "\033[32m设置成功!!!\033[0m"
|
||||||
fi
|
fi
|
||||||
elif [ "$num" = 2 ]; then
|
elif [ "$num" = 2 ]; then
|
||||||
read -p "请输入新的DNS > " dns_fallback
|
read -p "请输入新的DNS > " dns_fallback
|
||||||
dns_fallback=$(echo $dns_fallback | sed 's/|/\,\ /')
|
dns_fallback=$(echo $dns_fallback | sed 's/|/\,\ /g')
|
||||||
if [ -n "$dns_fallback" ]; then
|
if [ -n "$dns_fallback" ]; then
|
||||||
setconfig dns_fallback \'$dns_fallback\'
|
setconfig dns_fallback \'$dns_fallback\'
|
||||||
echo -e "\033[32m设置成功!!!\033[0m"
|
echo -e "\033[32m设置成功!!!\033[0m"
|
||||||
|
|
|
@ -218,9 +218,9 @@ modify_yaml(){
|
||||||
b=$(grep -n "^prox" $yaml | head -1 | cut -d ":" -f 1)
|
b=$(grep -n "^prox" $yaml | head -1 | cut -d ":" -f 1)
|
||||||
b=$((b-1))
|
b=$((b-1))
|
||||||
mkdir -p $tmpdir > /dev/null
|
mkdir -p $tmpdir > /dev/null
|
||||||
sed "${a},${b}d" $yaml > $tmpdir/rule.yaml
|
sed "${a},${b}d" $yaml > $tmpdir/proxy.yaml
|
||||||
#跳过本地tls证书验证
|
#跳过本地tls证书验证
|
||||||
[ "$skip_cert" = "已开启" ] && sed -i '10,99s/skip-cert-verify: false/skip-cert-verify: true/' $tmpdir/rule.yaml
|
[ "$skip_cert" = "已开启" ] && sed -i '10,99s/skip-cert-verify: false/skip-cert-verify: true/' $tmpdir/proxy.yaml
|
||||||
#添加配置
|
#添加配置
|
||||||
cat > $tmpdir/set.yaml <<EOF
|
cat > $tmpdir/set.yaml <<EOF
|
||||||
mixed-port: $mix_port
|
mixed-port: $mix_port
|
||||||
|
@ -238,13 +238,14 @@ $exper
|
||||||
$dns
|
$dns
|
||||||
EOF
|
EOF
|
||||||
[ -f $clashdir/user.yaml ] && yaml_user=$clashdir/user.yaml
|
[ -f $clashdir/user.yaml ] && yaml_user=$clashdir/user.yaml
|
||||||
cat $tmpdir/set.yaml $yaml_user $tmpdir/rule.yaml > $tmpdir/config.yaml
|
[ -f $clashdir/rules.yaml ] && yaml_rules=$clashdir/rules.yaml
|
||||||
|
cat $tmpdir/set.yaml $yaml_user $tmpdir/proxy.yaml $yaml_rules > $tmpdir/config.yaml
|
||||||
if [ "$tmpdir" != "$bindir" ];then #如果没有使用小闪存模式
|
if [ "$tmpdir" != "$bindir" ];then #如果没有使用小闪存模式
|
||||||
cmp -s $tmpdir/config.yaml $yaml
|
cmp -s $tmpdir/config.yaml $yaml
|
||||||
[ "$?" != 0 ] && mv -f $tmpdir/config.yaml $yaml || rm -f $tmpdir/config.yaml
|
[ "$?" != 0 ] && mv -f $tmpdir/config.yaml $yaml || rm -f $tmpdir/config.yaml
|
||||||
fi
|
fi
|
||||||
rm -f $tmpdir/set.yaml
|
rm -f $tmpdir/set.yaml
|
||||||
rm -f $tmpdir/rule.yaml
|
rm -f $tmpdir/proxy.yaml
|
||||||
}
|
}
|
||||||
#设置路由规则
|
#设置路由规则
|
||||||
start_redir(){
|
start_redir(){
|
||||||
|
|
Loading…
Reference in New Issue
Block a user