Open GoogleCodeExporter opened 9 years ago
另外,看到这个帖子的人不知有没有使用dd-wrt路由器中dnsmasq�
��?求每次打开路由器后自动更新此hosts的方法
Original comment by wyf88.1...@gmail.com
on 29 Dec 2011 at 6:51
[deleted comment]
自己用网上的某个脚本简单改了改
#!/bin/sh
logger WAN up script executing
sleep 2
if test ! -s /tmp/dlhosts
then
cat >/tmp/dlhosts <<"EOF"
logger Downloading hosts
cd /tmp
wget -O smarthosts http://smarthosts.googlecode.com/svn/trunk/dnsmasq.conf
cat dnsmasq.conf smarthosts > newconf
rm dnsmasq.conf
mv newconf dnsmasq.conf
logger Restarting dnsmasq
killall dnsmasq
dnsmasq --conf-file=/tmp/dnsmasq.conf
EOF
chmod 777 /tmp/dlhosts
/tmp/dlhosts
fi
grep -q '/tmp/dlhosts' /tmp/crontab ||
echo "45 23 * * 5 root /tmp/dlhosts" >>/tmp/crontab
Original comment by wyf88.1...@gmail.com
on 30 Dec 2011 at 5:44
感谢反馈。
今晚的更新会解决这个问题。
Original comment by azly...@gmail.com
on 2 Jan 2012 at 6:02
Original issue reported on code.google.com by
wyf88.1...@gmail.com
on 29 Dec 2011 at 6:47Attachments: