From df153c9be095c3d7c86f23a81015ec5d04a9f34e Mon Sep 17 00:00:00 2001 From: juewuy Date: Sun, 13 Nov 2022 18:33:32 +0800 Subject: [PATCH] =?UTF-8?q?v1.6.6=20~=E6=96=B0=E5=A2=9ETproxy=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=20=20=20=C2=B7tcp=20=20=20=C2=B7MAC=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=20=20=20=C2=B7=E5=B8=B8=E7=94=A8=E7=AB=AF=E5=8F=A3=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=20=20=20=C2=B7CNIP=E7=BB=95=E8=BF=87=20=20=20=C2=B7?= =?UTF-8?q?=E5=B1=8F=E8=94=BDQUIC=20=20=20=C2=B7ipv6=E6=94=AF=E6=8C=81(?= =?UTF-8?q?=E6=9C=AA=E6=B5=8B=E8=AF=95)=20~=E6=96=B0=E5=A2=9ENftables?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20=20=20=C2=B7tcp&udp=20=20=20=C2=B7MAC?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=20=20=20=C2=B7=E5=B8=B8=E7=94=A8=E7=AB=AF?= =?UTF-8?q?=E5=8F=A3=E8=BF=87=E6=BB=A4=20=20=20=C2=B7CNIP=E7=BB=95?= =?UTF-8?q?=E8=BF=87=20=20=20=C2=B7=E5=B1=8F=E8=94=BDQUIC=20=20=20=C2=B7ip?= =?UTF-8?q?v6=E6=94=AF=E6=8C=81(=E6=9C=AA=E6=B5=8B=E8=AF=95)=20=20=20?= =?UTF-8?q?=C2=B7=E6=9C=AC=E6=9C=BA=E4=BB=A3=E7=90=86=20=20=20=C2=B7docker?= =?UTF-8?q?=E4=BB=A3=E7=90=86(=E6=9C=AA=E6=B5=8B=E8=AF=95)=20~=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E9=83=A8=E5=88=86=E4=B8=8D=E5=8F=AF=E7=94=A8=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E6=BA=90=20~=E4=BF=AE=E5=A4=8D=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=9B=9E=E9=80=80=E5=8A=9F=E8=83=BD=E4=B8=8D=E5=8F=AF=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=20~=E4=BF=AE=E5=A4=8D=E9=83=A8?= =?UTF-8?q?=E5=88=86Linux=E8=AE=BE=E5=A4=87grep=E5=91=BD=E4=BB=A4=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98=20~=E5=B0=9D=E8=AF=95?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E5=8D=8E=E7=A1=95=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E5=BC=80=E6=9C=BA?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E7=9A=84=E9=97=AE=E9=A2=98=20~=E5=B0=9D?= =?UTF-8?q?=E8=AF=95=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=8F=90=E7=A4=BAip6tables=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/getdate.sh | 13 +++++-------- scripts/start.sh | 14 ++++++++------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 4c2847b..c85044c 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -763,8 +763,7 @@ setserver(){ echo -e " 2 \033[32m正式版\033[0m&fastgit.org源" echo -e " 3 \033[36m公测版\033[0m&Github源(本机clash服务加速)" echo -e " 4 \033[36m公测版\033[0m&ShellClash源" - echo -e " 5 \033[36m公测版\033[0m&githubusercontents加速" - echo -e " 6 \033[36m公测版\033[0m&fastgit.org源" + echo -e " 5 \033[36m公测版\033[0m&fastgit.org源" echo -e " 7 \033[33m内测版\033[0m(请加TG讨论组:\033[4;36mhttps://t.me/ShellClash\033[0m)" echo -e " 8 自定义源地址(用于本地源或自建源)" echo -e " 9 \033[31m版本回退\033[0m" @@ -787,10 +786,6 @@ setserver(){ release_url='' saveserver elif [ "$num" = 5 ]; then - update_url='https://raw.githubusercontents.com/juewuy/ShellClash/master' - release_url='' - saveserver - elif [ "$num" = 6 ]; then update_url='https://raw.fastgit.org/juewuy/ShellClash/master' release_url='' saveserver @@ -810,7 +805,8 @@ setserver(){ fi elif [ "$num" = 9 ]; then echo ----------------------------------------------- - $clashdir/start.sh webget /tmp/clashrelease https://raw.githubusercontents.com/juewuy/ShellClash/master/bin/release_version echooff rediroff 2>/tmp/clashrelease + echo -e "\033[33m如无法连接,请务必先启用clash服务!!!\033[0m" + $clashdir/start.sh webget /tmp/clashrelease https://raw.githubusercontent.com/juewuy/ShellClash/master/bin/release_version echooff rediroff 2>/tmp/clashrelease echo -e "\033[31m请选择想要回退至的release版本:\033[0m" cat /tmp/clashrelease | awk '{print " "NR" "$1}' echo -e " 0 返回上级菜单" @@ -819,13 +815,14 @@ setserver(){ setserver elif [ $num -le $(cat /tmp/clashrelease | awk 'END{print NR}') 2>/dev/null ]; then release_version=$(cat /tmp/clashrelease | awk '{print $1}' | sed -n "$num"p) - update_url="https://raw.githubusercontents.com/juewuy/ShellClash/$release_version" + update_url="https://raw.githubusercontent.com/juewuy/ShellClash/$release_version" saveserver release_url='' else echo ----------------------------------------------- echo -e "\033[31m输入有误,请重新输入!\033[0m" fi + rm -rf /tmp/clashrelease else errornum fi diff --git a/scripts/start.sh b/scripts/start.sh index 364edf2..259fdf8 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -506,8 +506,7 @@ start_dns_redir(){ #屏蔽OpenWrt内置53端口转发 iptables -t nat -D PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53 2> /dev/null iptables -t nat -D PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53 2> /dev/null - ip6tables -t nat -D PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53 2> /dev/null - ip6tables -t nat -D PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53 2> /dev/null + #设置dns转发 iptables -t nat -N clash_dns if [ "$macfilter_type" = "白名单" -a -n "$(cat $clashdir/mac)" ];then @@ -524,8 +523,10 @@ start_dns_redir(){ fi iptables -t nat -I PREROUTING -p udp --dport 53 -j clash_dns #ipv6DNS - ip6_nat=$(ip6tables -t nat -L 2>&1 | grep -o 'Chain') - if [ -n "$ip6_nat" ];then + if [ -n "$(lsmod | grep 'ip6table_nat')" ];then + #屏蔽OpenWrt内置53端口转发 + ip6tables -t nat -D PREROUTING -p udp --dport 53 -j REDIRECT --to-ports 53 2> /dev/null + ip6tables -t nat -D PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports 53 2> /dev/null ip6tables -t nat -N clashv6_dns > /dev/null 2>&1 if [ "$macfilter_type" = "白名单" -a -n "$(cat $clashdir/mac)" ];then #mac白名单 @@ -1129,8 +1130,9 @@ init) done profile=/etc/profile sed -i '' $profile #将软链接转化为一般文件 - elif [ -d "/jffs/clash" ];then - clashdir=/jffs/clash + elif [ -d "/jffs" ];then + sleep 30 + clashdir=$(cd $(dirname $0);pwd) if [ -w /etc/profile ];then profile=/etc/profile else