diff --git a/conf/google.conf b/conf/google.conf new file mode 100644 index 0000000..2b2e238 --- /dev/null +++ b/conf/google.conf @@ -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 diff --git a/sbin/hdns.sh b/sbin/hdns.sh new file mode 100755 index 0000000..f5d9073 --- /dev/null +++ b/sbin/hdns.sh @@ -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 "; + 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