通知 爱刷机 路由器教程 →→《省钱助手

使用smartdns直接屏蔽广告ad.sh脚本下载

2022-07-05
0评论
/
阅读
爱搜啊

此脚本配合

创建ad.sh文件,把下面内容复制进去即可

#!/bin/bash
touch /etc/smartdns/aaa.conf

wget -c --tries=0 -P/etc/smartdns  https://anti-ad.net/anti-ad-for-smartdns.conf
grep "^address" /etc/smartdns/anti-ad-for-smartdns.conf > /etc/smartdns/111.conf
cat /etc/smartdns/111.conf >> /etc/smartdns/aaa.conf
rm -f /etc/smartdns/anti-ad-for-smartdns.conf
rm -f /etc/smartdns/111.conf

wget -c --tries=0 -P/etc/smartdns https://raw.githubusercontent.com/jdlingyu/ad-wars/master/hosts
grep "^127" /etc/smartdns/hosts > /etc/smartdns/host
sed -i '1d' /etc/smartdns/host
sed -i 's/127.0.0.1 /address \//g;s/$/&\/#/g' /etc/smartdns/host
cat /etc/smartdns/host >> /etc/smartdns/aaa.conf
rm -f /etc/smartdns/hosts
rm -f /etc/smartdns/host

wget -c --tries=0 -P/etc/smartdns https://raw.githubusercontent.com/VeleSila/yhosts/master/hosts.txt
grep "^127" /etc/smartdns/hosts.txt > /etc/smartdns/host.txt
sed -i 's/127.0.0.1 /address \//g;s/$/&\/#/g' /etc/smartdns/host.txt
cat /etc/smartdns/host.txt >> /etc/smartdns/aaa.conf
rm -f /etc/smartdns/hosts.txt
rm -f /etc/smartdns/host.txt

wget -c --tries=0 -P/etc/smartdns https://raw.githubusercontent.com/Goooler/1024_hosts/master/hosts
grep "^127" /etc/smartdns/hosts > /etc/smartdns/host
sed -i 's/127.0.0.1 /address \//g;s/$/&\/#/g' /etc/smartdns/host
cat /etc/smartdns/hosts >> /etc/smartdns/aaa.conf
rm -f /etc/smartdns/hosts
rm -f /etc/smartdns/host

grep "^address" /etc/smartdns/aaa.conf > /etc/smartdns/bbb.conf
sort -n /etc/smartdns/bbb.conf | uniq >> ccc.conf
rm -f /etc/smartdns/aaa.conf
rm -f /etc/smartdns/bbb.conf
mv -f ccc.conf ad.conf
 
reboot

点击链接加入群聊三群:751529538

点击链接加入群聊二群:376877156

点击链接加入群聊【路由器交流群:622891808已满】

本站附件分享,如果附件失效,可以去找找看

诚通网盘附件百度网盘附件


饿了么红包

饿了么红包

标签: smartdns ad.sh
于2022-07-05发布