[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit

Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/ap/app/Script/scripts/upnp.sh b/ap/app/Script/scripts/upnp.sh
new file mode 100644
index 0000000..732e0a6
--- /dev/null
+++ b/ap/app/Script/scripts/upnp.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# $Id: upnp.sh,v 1.22.6.1 2008-10-02 12:57:42 winfred Exp $
+#
+# usage: upnp.sh
+#
+path_sh=`nv get path_sh`
+. $path_sh/global.sh
+echo "Info: upnp.sh start " >> $test_log
+
+
+# stop all
+killall -9 miniupnpd
+sh $path_sh/upnp_ipt_remove.sh
+
+# upnp
+upnp=`nv get upnpEnabled`
+if [ "$upnp" = "1" ]; then
+	if [ -f $path_conf/pidfile/miniupnp.pid ]
+	then
+		rm -f $path_conf/pidfile/miniupnpd.pid
+	fi
+	
+	if [ -f /var/run/miniupnpd.pid ]
+	then
+		rm -f /var/run/miniupnpd.pid
+	fi	
+	
+	if [ -f $path_conf/miniupnpd.conf ]
+	then
+		echo "$path_conf/miniupnpd.conf already exist!"
+	    rm $path_conf/miniupnpd.conf
+	fi
+	
+	cp $path_ro/miniupnpd_temp.conf $path_conf/miniupnpd.conf
+	
+	gw=`nv get lan_ipaddr`
+	. $path_sh/upnp_set_listenip.sh $gw/16
+	
+	route del -net 239.0.0.0 netmask 255.0.0.0 dev $lan_if
+	route add -net 239.0.0.0 netmask 255.0.0.0 dev $lan_if 2>>$test_log
+	if [ $? -ne 0 ];then
+	    echo "Error: route add -net 239.0.0.0 netmask 255.0.0.0 dev $lan_if failed." >> $test_log
+    fi
+	. $path_sh/upnp_ipt_init.sh
+	miniupnpd -f $path_conf/miniupnpd.conf &
+fi