ASR_BASE

Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/target/linux/mmp/base-files/sbin/zippass.sh b/target/linux/mmp/base-files/sbin/zippass.sh
new file mode 100755
index 0000000..baf6430
--- /dev/null
+++ b/target/linux/mmp/base-files/sbin/zippass.sh
@@ -0,0 +1,51 @@
+#!/bin/sh
+
+pipe=$1
+pipe_now=`uci get cmdline.PIPE 2> /dev/null`
+
+if [ "$pipe" == "get" ]; then
+	if [ "$pipe_now" == "1" ]; then
+		echo 1
+	else
+		echo 0
+	fi
+	exit 0
+fi
+
+if [ "$pipe" != "0" ] && [ "$pipe" != "1" ]; then
+	echo "invaild pipe mode parameter" > /dev/kmsg
+	exit 0
+fi
+
+if [ "$pipe_now" == "1" ]; then
+	if [ "1" == "$pipe" ]; then
+		exit 0
+	fi
+else
+	if [ "0" == "$pipe" ]; then
+		exit 0
+	fi
+fi
+
+if [ "$pipe" == "1" ]; then
+	cp -fp /etc/config/network /etc/config/network_mifi
+	cp -fp /etc/config/dhcp /etc/config/dhcp_mifi
+	cp -fp /rom/etc/config/network /etc/config/network
+	/etc/init.d/forwarder stop
+	uci set cmdline.PIPE=1
+	uci commit cmdline
+	sync
+	/etc/init.d/network restart
+	/etc/init.d/cm.init restart
+	/etc/init.d/forwarder start
+else
+	cp -fp /etc/config/network_mifi /etc/config/network
+	cp -fp /etc/config/dhcp_mifi /etc/config/dhcp
+	/etc/init.d/forwarder stop
+	uci del cmdline.PIPE
+	uci commit cmdline
+	sync
+	/etc/init.d/network restart
+	/etc/init.d/cm.init restart
+	/etc/init.d/forwarder start
+fi