zte's code,first commit
Change-Id: I9a04da59e459a9bc0d67f101f700d9d7dc8d681b
diff --git a/ap/app/Script/scripts/config-igmpproxy.sh b/ap/app/Script/scripts/config-igmpproxy.sh
new file mode 100644
index 0000000..353970e
--- /dev/null
+++ b/ap/app/Script/scripts/config-igmpproxy.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# usage: see function usage()
+
+path_sh=`nv get path_sh`
+. $path_sh/global.sh
+
+
+usage () {
+ echo "usage: config-udhcpd.sh [option]..."
+ echo "options:"
+ echo " -h : print this help"
+ echo " -c : clean the conf file"
+ echo " -u interface : set upstream interface for server"
+ echo " -d interface1 [interface2].. : set downstream interface for client"
+ echo " -s addr : set gateway of upstream interface"
+ echo " -r : run igmpproxy"
+ exit
+}
+
+config () {
+ case "$1" in
+ "-c")
+ sed -i '36,$d' $fname;;
+ "-u")
+ sed -i "30c phyint $2 upstream ratelimit 0 threshold 1" $fname;;
+ "-d")
+ sed -i '$a phyint '"$2"' downstream ratelimit 0 threshold 1' $fname
+ sed -i '$a' $fname;;
+ "-s")
+ sed -i "31c altnet $2/24" $fname;;
+
+ esac
+
+}
+
+
+fname=$path_conf"/igmpproxy.conf"
+
+case "$1" in
+
+
+ "-h") usage;;
+ "-c") config "$1";;
+ "-u") config "$1" "$2";;
+ "-s") config "$1" "$2";;
+ "-d") config "$1" "$2" "$3" "$4";;
+ "-r") igmpproxy& ;;
+ *) usage;;
+esac
+
+