diff --git a/bin/clashfm.tar.gz b/bin/clashfm.tar.gz index e7fe050..ca0bda5 100644 Binary files a/bin/clashfm.tar.gz and b/bin/clashfm.tar.gz differ diff --git a/bin/version b/bin/version index 549a36a..a94837e 100644 --- a/bin/version +++ b/bin/version @@ -3,4 +3,4 @@ clashpre_v=2021.09.15 clash_v=v1.7.1 meta_v=alpha GeoIP_v=20220426 -versionsh=1.5.8 +versionsh=1.5.8fix diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 0ae0333..d9e1e3f 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -749,7 +749,7 @@ setserver(){ echo -e " 2 \033[36m测试版\033[0m&Github源(本机clash服务加速)" echo -e " 3 \033[36m测试版\033[0m&Jsdelivr-CDN源" echo -e " 4 \033[36m测试版\033[0m&Github源(githubusercontents加速)" - echo -e " 4 \033[36m测试版\033[0m&Github源(fastgit.org加速)" + echo -e " 5 \033[36m测试版\033[0m&Github源(fastgit.org加速)" [ -z "$(curl -V 2>/dev/null)" ] && [ -n "$(wget -V 2>&1 | grep BusyBox)" ] && echo -e " 7 \033[33mHttp专用源\033[0m" echo -e " 8 自定义源地址(用于本地源或自建源)" echo -e " 9 \033[31m版本回退\033[0m" diff --git a/scripts/start.sh b/scripts/start.sh index 42838ce..1c83441 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -136,6 +136,10 @@ autoSSH(){ #备份还原SSH秘钥 [ -f $clashdir/dropbear_rsa_host_key ] && ln -sf $clashdir/dropbear_rsa_host_key /etc/dropbear/dropbear_rsa_host_key } +host_lan(){ + host_lan=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -oE '\ 1(92|0|72)\.' | grep -oE '1(92|0|72)' | head -n 1) + [ -n "$host_lan" ] && host_lan="-s ${host_lan}.0.0.0/8" +} #配置文件相关 getyaml(){ [ -z "$rule_link" ] && rule_link=1 @@ -442,10 +446,9 @@ start_redir(){ iptables -t nat -A clash -p tcp $ports -j REDIRECT --to-ports $redir_port fi #获取局域网host地址 - host_lan=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -oE '\ 1(92|0|72)\.' | grep -oE '1(92|0|72)' | head -n 1) - [ -n "$host_lan" ] && host_lan=${host_lan}.0.0.0/8 + host_lan #将PREROUTING链指向clash链 - iptables -t nat -A PREROUTING -p tcp -s $host_lan -j clash + iptables -t nat -A PREROUTING -p tcp $host_lan -j clash #公网访问功能 if [ "$public_support" = "已开启" ];then iptables -I INPUT -p tcp --dport $mix_port -j ACCEPT @@ -606,13 +609,15 @@ start_output(){ iptables -t nat -A OUTPUT -p udp -j clash_dns_out } stop_iptables(){ + host_lan #重置iptables规则 ip rule del fwmark 1 table 100 2> /dev/null ip route del local default dev lo table 100 2> /dev/null - iptables -t nat -D PREROUTING -p tcp -j clash 2> /dev/null + iptables -t nat -D PREROUTING -p tcp $host_lan -j clash 2> /dev/null iptables -D INPUT -p tcp --dport $mix_port -j ACCEPT 2> /dev/null iptables -D INPUT -p tcp --dport $db_port -j ACCEPT 2> /dev/null - iptables -t nat -D PREROUTING -p udp -j clash_dns 2> /dev/null + iptables -t nat -D PREROUTING -p udp --dport 53 -j clash_dns 2> /dev/null + iptables -t nat -D PREROUTING -p tcp --dport 53 -j clash_dns 2> /dev/null iptables -t nat -D PREROUTING -p tcp -d 8.8.8.8 -j clash 2> /dev/null iptables -t nat -D PREROUTING -p tcp -d 8.8.4.4 -j clash 2> /dev/null iptables -t nat -D PREROUTING -s 172.16.0.0/12 -j clash 2> /dev/null