~修复查找进程功能在纯净模式也被禁用的bug
~修复在线生成配置文件功能部分bug
~修复自动获取局域网网段时获取错误的bug
~修复部分设备开启ipv4转发时报错的bug
~修复本机代理nft增强模式下未屏蔽保留地址的问题
This commit is contained in:
juewuy
2023-08-05 17:36:20 +08:00
parent 6786bc054c
commit 11152e8947
7 changed files with 18 additions and 13 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,4 +3,4 @@ clashpre_v=2022.11.25
clash_v=v1.7.1
meta_v=v1.15.0
GeoIP_v=20230729
versionsh=1.7.10e
versionsh=1.7.10f

View File

@@ -17,11 +17,12 @@ linkconfig(){
echo -----------------------------------------------
echo 0 返回上级菜单
read -p "请输入对应数字 > " num
if [ -z "$num" ] || [ "$num" -gt 10 ];then
totalnum=$(grep -acE '^5' $clashdir/configs/servers.list )
if [ -z "$num" ] || [ "$num" -gt "$totalnum" ];then
errornum
elif [ "$num" = 0 ];then
echo
elif [ "$num" -le 10 ];then
elif [ "$num" -le "$totalnum" ];then
#将对应标记值写入mark
rule_link=$num
setconfig rule_link $rule_link
@@ -33,16 +34,17 @@ linkserver(){
echo -----------------------------------------------
echo -e "\033[36m以下为互联网采集的第三方服务器具体安全性请自行斟酌\033[0m"
echo -e "\033[32m感谢以下作者的无私奉献\033[0m"
echo 当前使用后端为:$(grep -aE '^5' $clashdir/configs/servers.list | sed -n ""$server_link"p" | awk '{print $2}')
echo 当前使用后端为:$(grep -aE '^3|^4' $clashdir/configs/servers.list | sed -n ""$server_link"p" | awk '{print $3}')
grep -aE '^3|^4' $clashdir/configs/servers.list | awk '{print " "NR" "$3" "$2}'
echo -----------------------------------------------
echo 0 返回上级菜单
read -p "请输入对应数字 > " num
if [ -z "$num" ] || [ "$num" -gt 5 ];then
totalnum=$(grep -acE '^3|^4' $clashdir/configs/servers.list )
if [ -z "$num" ] || [ "$num" -gt "$totalnum" ];then
errornum
elif [ "$num" = 0 ];then
echo
elif [ "$num" -le 5 ];then
elif [ "$num" -le "$totalnum" ];then
#将对应标记值写入mark
server_link=$num
setconfig server_link $server_link
@@ -1394,8 +1396,10 @@ userguide(){
echo -----------------------------------------------
echo -e "\033[33m检测到你的设备尚未开启ip转发局域网设备将无法正常连接网络是否立即开启\033[0m"
read -p "是否开启?(1/0) > " res
[ "$res" = 1 ] && echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf
[ "$?" = 0 ] && /etc/init.d/procps restart && echo "已成功开启ipv4转发如未正常开启请手动重启设备" || echo "开启失败!请自行谷歌查找当前设备的开启方法!"
[ "$res" = 1 ] && {
echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf
sysctl -w net.ipv4.ip_forward=1
} && echo "已成功开启ipv4转发如未正常开启请手动重启设备" || echo "开启失败!请自行谷歌查找当前设备的开启方法!"
fi
elif [ "$num" = 2 ];then
setconfig redir_mod "纯净模式"

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# Copyright (C) Juewuy
version=1.7.10e
version=1.7.10f
setdir(){
dir_avail(){

View File

@@ -141,9 +141,9 @@ mark_time(){
getlanip(){
i=1
while [ "$i" -le "10" ];do
host_ipv4=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep 'br' | grep -v 'iot' | grep -E ' 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/br.*$//g' ) #ipv4局域网网段
host_ipv6=$(ip a 2>&1 | grep -w 'inet6' | grep -E 'global' | sed 's/.*inet6.//g' | sed 's/scope.*$//g' ) #ipv6公网地址段
[ -f $TMPDIR/ShellClash_log ] && break
host_ipv4=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep 'br' | grep -Ev 'iot|metric' | grep -E ' 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/br.*$//g' ) #ipv4局域网网段
host_ipv6=$(ip a 2>&1 | grep -w 'inet6' | grep -E 'global' | sed 's/.*inet6.//g' | sed 's/scope.*$//g' ) #ipv6公网地址段
[ -n "$host_ipv4" -o -n "$host_ipv6" ] && break
sleep 2 && i=$((i+1))
done
@@ -288,7 +288,7 @@ modify_yaml(){
exper='experimental: {ignore-resolve-fail: true, interface-name: en0}'
#Meta内核专属配置
[ "$clashcore" = 'clash.meta' ] && {
find_process='find-process-mode: "off"'
[ "$redir_mod" != "纯净模式" ] && find_process='find-process-mode: "off"'
}
#dns配置
[ -z "$(cat $clashdir/yamls/user.yaml 2>/dev/null | grep '^dns:')" ] && {
@@ -890,7 +890,8 @@ start_nft(){
#Docker
type docker &>/dev/null && {
nft add chain inet shellclash docker { type nat hook prerouting priority -100 \; }
nft add rule inet shellclash docker ip saddr != {172.16.0.0/12} return
nft add rule inet shellclash docker ip saddr != {172.16.0.0/12} return #进代理docker网段
nft add rule inet shellclash docker ip daddr {$RESERVED_IP} return #过滤保留地址
nft add rule inet shellclash docker udp dport 53 redirect to $dns_port
nft add rule inet shellclash docker meta l4proto tcp mark set $fwmark redirect to $redir_port
}