1#! /bin/sh
2BR=${1:-"br549"}
3ETH0=${1:-"eth0"}
4ETH1=${1:-"eth1"}
5
6# fetch ip of working br0
7IP=`/sbin/ifconfig $BR | sed -n -e 's/^.*inet addr:\([0-9][0-9\.]*\).*$/\1/p'`
8echo "Using IP address $IP"
9
10while true;
11do
12	ifconfig $BR down
13	brctl delbr $BR
14	ifconfig $ETH0 $IP
15
16	ifconfig $ETH0 0.0.0.0
17	brctl addbr $BR
18	brctl addif $BR $ETH0
19	brctl addif $BR $ETH1
20	ifconfig $BR $IP
21	
22	sleep 10
23done
24