找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 4005|回复: 5

DD-WRT路由器使用DNSMASQ去广告脚本

[复制链接]
发表于 2017-6-6 17:54 | 显示全部楼层 |阅读模式
DD-WRT官方WIKI中的说明,使用了之后没效果,改成其它HOSTS版本也不行

先在系统COMMANDS那边把下面的脚本保存成STARTUP脚本
#!/bin/sh
logger WAN up script executing
if test -s /tmp/hosts0
then
        rm /tmp/hosts0
fi

logger Downloading http://www.mvps.org/winhelp2002/hosts.txt
wget -O - http://www.mvps.org/winhelp2002/hosts.txt | grep 0.0.0.0 |
        sed 's/[[:space:]]*#.*$//g;' |
        grep -v localhost | tr ' ' '\t' |
        tr -s '\t' | tr -d '\015' | sort -u >/tmp/hosts0
grep addn-hosts /tmp/dnsmasq.conf ||
        echo "addn-hosts=/tmp/hosts0" >>/tmp/dnsmasq.conf
logger Restarting dnsmasq
killall dnsmasq
dnsmasq --conf-file=/tmp/dnsmasq.conf

然后在CRON加入下面这个定时任务
0 12 * * * root /tmp/.rc_startup

我的恩山、我的无线 The best wifi forum is right here.
发表于 2017-7-25 15:44 | 显示全部楼层
管用 不!?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-8-11 19:27 | 显示全部楼层
无叶莲科我来看看,。,。,。,。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-2 01:40 | 显示全部楼层
怎么没效果
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-4 16:04 | 显示全部楼层
看不懂、、、、、、、
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2017-9-8 09:26 | 显示全部楼层
定时去广告脚本效果
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-20 05:28

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表