#!/bin/sh

# Take down all interfaces and delete bridge if present
iface=`ifconfig  -a | grep eth0`
if [ "$iface" != "" ]; then
       ifconfig eth0 down
fi; 
iface=`ifconfig  -a | grep eth1`
if [ "$iface" != "" ]; then
       ifconfig eth1 down
fi; 
iface=`ifconfig  -a | grep br0`
if [ "$iface" != "" ]; then
       ifconfig br0 down
        brctl delbr br0
fi; 
iface=`ifconfig  -a | grep wan0`
if [ "$iface" != "" ]; then
       ifconfig wan0 down
fi; 

# Turn of routing
echo 0 > /proc/sys/net/ipv4/ip_forward