diff --git a/bin/clashfm.tar.gz b/bin/clashfm.tar.gz index 1914139..d87bea2 100644 Binary files a/bin/clashfm.tar.gz and b/bin/clashfm.tar.gz differ diff --git a/bin/version b/bin/version index 6d03979..46da0e7 100644 --- a/bin/version +++ b/bin/version @@ -3,4 +3,4 @@ clash_v=1.7.1 clashpre_v=2021.09.15 GeoIP_v=202112310302 meta_v=1.9.0 -versionsh=1.4.11 +versionsh=1.4.12 diff --git a/scripts/clash.sh b/scripts/clash.sh index 07199cc..e1e5c36 100644 --- a/scripts/clash.sh +++ b/scripts/clash.sh @@ -259,6 +259,9 @@ setport(){ setdns(){ [ -z "$dns_nameserver" ] && dns_nameserver='114.114.114.114, 223.5.5.5' [ -z "$dns_fallback" ] && dns_fallback='1.0.0.1, 8.8.4.4' + [ -z "$ipv6_dns" ] && ipv6_dns=已开启 + [ -z "$dns_redir" ] && dns_redir=未开启 + [ -z "$dns_no" ] && dns_no=未禁用 echo ----------------------------------------------- echo -e "当前基础DNS:\033[32m$dns_nameserver\033[0m" echo -e "fallbackDNS:\033[36m$dns_fallback\033[0m" @@ -268,9 +271,10 @@ setdns(){ echo -e " 1 修改\033[32m基础DNS\033[0m" echo -e " 2 修改\033[36mfallback_DNS\033[0m" echo -e " 3 \033[33m重置\033[0mDNS配置" - echo -e " 4 禁用内置DNS(慎用)" - echo -e " 5 使用\033[32m加密DNS\033[0m" - echo -e " 6 使用\033[32mdnsmasq转发DNS\033[0m" + echo -e " 4 一键配置\033[32m加密DNS\033[0m" + echo -e " 5 ipv6_dns解析: \033[36m$ipv6_dns\033[0m ————建议开启" + echo -e " 6 Dnsmasq转发: \033[36m$dns_redir\033[0m ————用于解决dns劫持失败的问题" + echo -e " 7 禁用内置DNS: \033[36m$dns_no\033[0m ————不明勿动" echo -e " 0 返回上级菜单" echo ----------------------------------------------- read -p "请输入对应数字 > " num @@ -284,6 +288,7 @@ setdns(){ echo -e "\033[32m设置成功!!!\033[0m" fi setdns + elif [ "$num" = 2 ]; then read -p "请输入新的DNS > " dns_fallback dns_fallback=$(echo $dns_fallback | sed 's/|/\,\ /g') @@ -292,6 +297,7 @@ setdns(){ echo -e "\033[32m设置成功!!!\033[0m" fi setdns + elif [ "$num" = 3 ]; then dns_nameserver="" dns_fallback="" @@ -299,14 +305,8 @@ setdns(){ setconfig dns_fallback echo -e "\033[33mDNS配置已重置!!!\033[0m" setdns + elif [ "$num" = 4 ]; then - echo ----------------------------------------------- - echo -e "\033[31m仅限搭配其他DNS服务(比如dnsmasq、smartDNS)时使用!\033[0m" - dns_no=已禁用 - setconfig dns_no $dns_no - echo -e "\033[33m已禁用内置DNS!!!\033[0m" - setdns - elif [ "$num" = 5 ]; then $clashdir/start.sh webget /tmp/ssl_test https://www.baidu.com echooff rediron skipceroff if [ "$?" = "1" ];then echo ----------------------------------------------- @@ -327,13 +327,48 @@ setdns(){ rm -rf /tmp/ssl_test sleep 1 setdns + + elif [ "$num" = 5 ]; then + echo ----------------------------------------------- + if [ "$ipv6_dns" = "未开启" ]; then + echo -e "\033[32m开启成功!!\033[0m" + ipv6_dns=已开启 + else + echo -e "\033[33m禁用成功!!\033[0m" + ipv6_dns=未开启 + fi + sleep 1 + setconfig ipv6_dns $ipv6_dns + setdns + elif [ "$num" = 6 ]; then echo ----------------------------------------------- - echo -e "\033[31m将使用OpenWrt中Dnsmasq插件自带的DNS转发功能转发DNS请求至clash内核!\033[0m" - echo -e "\033[32m启用后将禁用本插件自带的iptables转发功能\033[0m" - dns_redir=已开启 + if [ "$dns_redir" = "未开启" ]; then + echo -e "\033[31m将使用OpenWrt中Dnsmasq插件自带的DNS转发功能转发DNS请求至clash内核!\033[0m" + echo -e "\033[33m启用后将禁用本插件自带的iptables转发功能\033[0m" + dns_redir=已开启 + echo -e "\033[32m已启用Dnsmasq转发DNS功能!!!\033[0m" + sleep 1 + else + echo -e "\033[33m禁用成功!!\033[0m" + dns_redir=未开启 + fi + sleep 1 setconfig dns_redir $dns_redir - echo -e "\033[33m已启用Dnsmasq转发DNS功能!!!\033[0m" + setdns + + elif [ "$num" = 7 ]; then + echo ----------------------------------------------- + if [ "$dns_no" = "未禁用" ]; then + echo -e "\033[31m仅限搭配其他DNS服务(比如dnsmasq、smartDNS)时使用!\033[0m" + dns_no=已禁用 + echo -e "\033[32m已禁用内置DNS!!!\033[0m" + else + dns_no=未禁用 + echo -e "\033[33m已启用内置DNS!!!\033[0m" + fi + sleep 1 + setconfig dns_no $dns_no setdns fi } diff --git a/scripts/start.sh b/scripts/start.sh index fffb277..8d1f176 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -20,6 +20,7 @@ getconfig(){ [ -z "$dns_over" ] && dns_over=已开启 [ -z "$modify_yaml" ] && modify_yaml=未开启 [ -z "$ipv6_support" ] && ipv6_support=未开启 + [ -z "$ipv6_dns" ] && ipv6_dns=已开启 [ -z "$start_old" ] && start_old=未开启 [ -z "$local_proxy" ] && local_proxy=未开启 [ -z "$mix_port" ] && mix_port=7890 @@ -225,6 +226,7 @@ modify_yaml(){ mode='mode: Rule' log='log-level: info' [ "$ipv6_support" = "已开启" ] && ipv6='ipv6: true' || ipv6='ipv6: false' + [ "$ipv6_dns" = "已开启" ] && dns_v6='ipv6: true' || dns_v6=$ipv6 external="external-controller: 0.0.0.0:$db_port" [ -d $clashdir/ui ] && db_ui=ui if [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" ];then @@ -239,7 +241,7 @@ modify_yaml(){ if [ "$dns_mod" = "fake-ip" ];then dns='dns: {enable: true, listen: 0.0.0.0:'$dns_port', use-hosts: true, fake-ip-range: 198.18.0.1/16, enhanced-mode: fake-ip, fake-ip-filter: ["*.lan", "time.windows.com", "time.nist.gov", "time.apple.com", "time.asia.apple.com", "*.ntp.org.cn", "*.openwrt.pool.ntp.org", "time1.cloud.tencent.com", "time.ustc.edu.cn", "pool.ntp.org", "ntp.ubuntu.com", "ntp.aliyun.com", "ntp1.aliyun.com", "ntp2.aliyun.com", "ntp3.aliyun.com", "ntp4.aliyun.com", "ntp5.aliyun.com", "ntp6.aliyun.com", "ntp7.aliyun.com", "time1.aliyun.com", "time2.aliyun.com", "time3.aliyun.com", "time4.aliyun.com", "time5.aliyun.com", "time6.aliyun.com", "time7.aliyun.com", "*.time.edu.cn", "time1.apple.com", "time2.apple.com", "time3.apple.com", "time4.apple.com", "time5.apple.com", "time6.apple.com", "time7.apple.com", "time1.google.com", "time2.google.com", "time3.google.com", "time4.google.com", "music.163.com", "*.music.163.com", "*.126.net", "musicapi.taihe.com", "music.taihe.com", "songsearch.kugou.com", "trackercdn.kugou.com", "*.kuwo.cn", "api-jooxtt.sanook.com", "api.joox.com", "joox.com", "y.qq.com", "*.y.qq.com", "streamoc.music.tc.qq.com", "mobileoc.music.tc.qq.com", "isure.stream.qqmusic.qq.com", "dl.stream.qqmusic.qq.com", "aqqmusic.tc.qq.com", "amobile.music.tc.qq.com", "*.xiami.com", "*.music.migu.cn", "music.migu.cn", "*.msftconnecttest.com", "*.msftncsi.com", "localhost.ptlogin2.qq.com", "*.*.*.srv.nintendo.net", "*.*.stun.playstation.net", "xbox.*.*.microsoft.com", "*.*.xboxlive.com", "proxy.golang.org","*.sgcc.com.cn","*.alicdn.com","*.aliyuncs.com"], default-nameserver: ['$dns_default', 127.0.0.1:53], nameserver: ['$dns_nameserver', 127.0.0.1:53], fallback: ['$dns_fallback'], fallback-filter: {geoip: true}}' else - dns='dns: {enable: true, '$ipv6', listen: 0.0.0.0:'$dns_port', use-hosts: true, enhanced-mode: redir-host, default-nameserver: ['$dns_default', 127.0.0.1:53], nameserver: ['$dns_nameserver$dns_local'], fallback: ['$dns_fallback'], fallback-filter: {geoip: true}}' + dns='dns: {enable: true, '$dns_v6', listen: 0.0.0.0:'$dns_port', use-hosts: true, enhanced-mode: redir-host, default-nameserver: ['$dns_default', 127.0.0.1:53], nameserver: ['$dns_nameserver$dns_local'], fallback: ['$dns_fallback'], fallback-filter: {geoip: true}}' fi #设置目录 yaml=$clashdir/config.yaml