Skip to content

Commit

Permalink
初始版本
Browse files Browse the repository at this point in the history
这是0.1版本 :)
  • Loading branch information
hdcola committed Jun 30, 2014
0 parents commit a68b7c1
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
11 changes: 11 additions & 0 deletions conf/google.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
address=/google-analytics.com/google.com/216.239.32.6
address=/checkout.google.com/74.125.20.115
address=/accounts.google.com/74.125.21.84
address=/mail.google.com/74.125.70.17
address=/.mail.google.com/74.125.22.189
address=/.googleusercontent.com/.ggpht.com/74.125.22.133
address=/.gstatic.com/173.194.37.207
address=/.googleapis.com/74.125.205.95
address=/appspot.com/74.125.26.141
address=/googlecode.com/74.125.26.82
address=/google.com.hk/119.81.142.202
52 changes: 52 additions & 0 deletions sbin/hdns.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/bin/sh

config="/system/conf/dnsmasq.conf";
hdnsconf="conf-dir=/data/apps/hdns/conf";

initconfig()
{
/bin/sed -ie "/address=\/modouwifi.net/d" $config;
toip=`nvram_get 2860 lan_ipaddr`;
strategy="address=/modouwifi.net/$toip";
/system/sbin/writesys.sh;
echo $strategy > $config;
echo $hdnsconf >> $config;
/system/sbin/writesys.sh close;
}

dnsstop()
{
pid=`/bin/ps|grep dnsmasq|grep -v grep|awk '{print $1}'`;
if [ "$pid" != "" ]; then
/bin/kill $pid;
else
/usr/bin/killall dnsmasq;
fi
}

dnsstart()
{
initconfig;
dnsstop;
/bin/dnsmasq -C "$config" &
}

# main
if [ $# -lt 1 ]; then
echo "ERROR: action missing";
echo "syntax: dns.sh <start|stop|restart>";
echo "example: dns.sh start or dns.sh stop"
fi

if [ "$1" == "start" ]; then
dnsstart;
fi

if [ "$1" == "stop" ]; then
dnsstop;
exit $?;
fi

if [ "$1" == "restart" ]; then
dnsstart;
fi

0 comments on commit a68b7c1

Please sign in to comment.