#! /bin/sh
# /etc/init.d/bridge: Start or Stop bridge operation
# This is a script for Debian style management of the bridge
# It will also work with any other distribution on its own.

test -x /usr/sbin/brcfg || exit 0

# Here all interfaces to be bridged should be listed
INTERFACES="eth0 eth1"

case "$1" in
  start)
	for i in $INTERFACES; do ifconfig $i up promisc; done
	brcfg -enable
    ;;
  stop)
	brcfg -disable
	for i in $INTERFACES; do ifconfig $i -promisc; done
    ;;
  *)
    echo "Usage: /etc/init.d/bridge {start|stop}"
    exit 1
esac

exit 0
