zte's code,first commit
Change-Id: I9a04da59e459a9bc0d67f101f700d9d7dc8d681b
diff --git a/ap/app/Script/scripts/config-dns.sh b/ap/app/Script/scripts/config-dns.sh
new file mode 100644
index 0000000..5237ca3
--- /dev/null
+++ b/ap/app/Script/scripts/config-dns.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# $Id: config-dns.sh, v10.08.05, 2010-08-05 15:00:00
+#
+# usage: config-dns.sh [<dns1>] [<dns2>]
+#
+path_sh=`nv get path_sh`
+. $path_sh/global.sh
+echo "Info: config-dns.sh $1 $2 start" >> $test_log
+fname=$path_conf"/etc/resolv.conf"
+fbak=$path_conf"/etc/resolv_conf.bak"
+
+# in case no previous file
+touch $fname
+
+# backup file without nameserver part
+sed -e '/nameserver/d' $fname > $fbak
+
+# set primary and seconday DNS
+if [ "x$1" != "x" ]; then
+ echo "nameserver $1" > $fname
+else # empty dns
+ rm -f $fname
+fi
+if [ "x$2" != "x" ]; then
+ echo "nameserver $2" >> $fname
+fi
+
+cat $fbak >> $fname
+rm -f $fbak
+