#!/bin/sh
#
# Created by zhangwenbo10103015 for bridge
# Copyright (c) 2012 ZTE Incorporated.  All Rights Reserved.
# ZTE Proprietary and Confidential.

# zdata_bridge    script for ZTE net-bridge

case "$1" in
    POWER_ON)
        busybox brctl addbr br0
        busybox brctl stp br0 off
        busybox ifconfig br0 up
    ;;
    ETH0_UP)
        busybox brctl delif br0 eth0
        busybox brctl addif br0 eth0
        busybox ifconfig eth0 0.0.0.0
    ;;
    ECM0_UP)
        busybox brctl delif br0 rndis0
        busybox brctl delif br0 ecm0
        busybox brctl addif br0 ecm0
        busybox ifconfig ecm0 0.0.0.0 up
    ;;
    RNDIS0_UP)
        busybox brctl delif br0 ecm0
        busybox brctl delif br0 rndis0
        busybox brctl addif br0 rndis0
        busybox ifconfig rndis0 0.0.0.0 up
    ;;
    *)
        exit 1 
    ;;
esac

