v1.3.6-test

~增加了对生成配置文件时指定clash为文件头的功能
~使用在线生成配置时,强制使用dler.io作为dler的api地址
~非root用户切换运行模式时,增加警告提示
~修复crontab命令偶尔报错的问题
~增加对谷歌dns的强制代理配置(尝试解决奈飞TV端问题)
~增加了部分fake-ip-filter地址
This commit is contained in:
juewuy 2021-06-12 13:16:54 +08:00
parent f0da10af6e
commit 8906077709
4 changed files with 8 additions and 8 deletions

Binary file not shown.

View File

@ -1,4 +1,4 @@
clash_v=1.6.0 clash_v=1.6.0
clashpre_v=2021.05.08 clashpre_v=2021.05.08
GeoIP_v=20210514 GeoIP_v=20210514
versionsh=1.3.5 versionsh=1.3.6

View File

@ -677,8 +677,8 @@ clashcfg(){
elif [ "$num" = 1 ]; then elif [ "$num" = 1 ]; then
if [ "$USER" != "root" -a "$USER" != "admin" ];then if [ "$USER" != "root" -a "$USER" != "admin" ];then
echo ----------------------------------------------- echo -----------------------------------------------
echo -e "\033[33m非root用户无法启用静态路由仅可以使用纯净模式\033[0m" read -p "非root用户可能无法正确配置其他模式依然尝试吗(1/0) > " res
sleep 1 [ "$res" = 1 ] && set_redir_mod
else else
set_redir_mod set_redir_mod
fi fi

View File

@ -82,7 +82,7 @@ logger(){
cronset(){ cronset(){
# 参数1代表要移除的关键字,参数2代表要添加的任务语句 # 参数1代表要移除的关键字,参数2代表要添加的任务语句
crondir=/tmp/cron_$USER crondir=/tmp/cron_$USER
crontab -l > $crondir crontab -l > $crondir 2>/dev/null
sed -i "/$1/d" $crondir sed -i "/$1/d" $crondir
sed -i '/^$/d' $crondir sed -i '/^$/d' $crondir
echo "$2" >> $crondir echo "$2" >> $crondir
@ -242,7 +242,7 @@ modify_yaml(){
exper='experimental: {ignore-resolve-fail: true, interface-name: en0}' exper='experimental: {ignore-resolve-fail: true, interface-name: en0}'
#dns配置 #dns配置
if [ "$dns_mod" = "fake-ip" ];then 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"], nameserver: ['$dns_nameserver', 127.0.0.1:53], fallback: ['$dns_fallback'], fallback-filter: {geoip: true}}' 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"], nameserver: ['$dns_nameserver', 127.0.0.1:53], fallback: ['$dns_fallback'], fallback-filter: {geoip: true}}'
else else
dns='dns: {enable: true, ipv6: true, listen: 0.0.0.0:'$dns_port', use-hosts: true, enhanced-mode: redir-host, nameserver: ['$dns_nameserver$dns_local'], fallback: ['$dns_fallback'], fallback-filter: {geoip: true}}' dns='dns: {enable: true, ipv6: true, listen: 0.0.0.0:'$dns_port', use-hosts: true, enhanced-mode: redir-host, nameserver: ['$dns_nameserver$dns_local'], fallback: ['$dns_fallback'], fallback-filter: {geoip: true}}'
fi fi
@ -326,6 +326,9 @@ start_redir(){
iptables -t nat -A clash -p tcp $ports -j REDIRECT --to-ports $redir_port iptables -t nat -A clash -p tcp $ports -j REDIRECT --to-ports $redir_port
fi fi
iptables -t nat -A PREROUTING -p tcp $lanhost -j clash iptables -t nat -A PREROUTING -p tcp $lanhost -j clash
#Google home DNS特殊处理
iptables -t nat -I PREROUTING -p tcp -d 8.8.8.8 -j clash
iptables -t nat -I PREROUTING -p tcp -d 8.8.4.4 -j clash
#设置ipv6转发 #设置ipv6转发
ip6_nat=$(ip6tables -t nat -L 2>&1 | grep -o 'Chain') ip6_nat=$(ip6tables -t nat -L 2>&1 | grep -o 'Chain')
if [ -n "$ip6_nat" -a "$ipv6_support" = "已开启" ];then if [ -n "$ip6_nat" -a "$ipv6_support" = "已开启" ];then
@ -368,9 +371,6 @@ start_dns(){
iptables -t nat -A clash_dns -p tcp --dport 53 -j REDIRECT --to $dns_port iptables -t nat -A clash_dns -p tcp --dport 53 -j REDIRECT --to $dns_port
fi fi
iptables -t nat -A PREROUTING -p udp -j clash_dns iptables -t nat -A PREROUTING -p udp -j clash_dns
#Google home DNS特殊处理
iptables -t nat -I PREROUTING -p tcp -d 8.8.8.8 -j clash_dns
iptables -t nat -I PREROUTING -p tcp -d 8.8.4.4 -j clash_dns
#ipv6DNS #ipv6DNS
ip6_nat=$(ip6tables -t nat -L 2>&1 | grep -o 'Chain') ip6_nat=$(ip6tables -t nat -L 2>&1 | grep -o 'Chain')
if [ -n "$ip6_nat" ];then if [ -n "$ip6_nat" ];then