File:  [ELWIX - Embedded LightWeight unIX -] / elwix / config / etc / uboot / rc.d / 015.bridge.stop
Revision 1.2.2.1: download - view: text, annotated - select for diffs - revision graph
Thu Mar 5 23:23:09 2015 UTC (9 years, 4 months ago) by misho
Branches: elwix2_3
Diff to: branchpoint 1.2: preferred, unified
adds aliases support

#!/bin/sh

IFACE="bridge0"

BRIDGED="em0 rl0 wlan0"
STP="em0 rl0"

OPTS=""
#IP="auto"
IP=""
ALIASES=""
#IP6="auto"
IP6=""
ALIASES6=""

[ -z "$IFACE" ] && exit

echo "Config Bridge interface $IFACE ..."

ifconfig $IFACE create || exit

for i in $BRIDGED; do
	ifconfig $IFACE addm $i
done
for i in $STP; do
	ifconfig $IFACE stp $i
done

if [ -n "$IP" ]; then
	if [ "$IP" = "auto" ]; then
		dhclient $IFACE
	else
		ifconfig $IFACE inet $IP
	fi
fi
for i in $ALIASES; do
	ifconfig $IFACE inet alias $i
done
if [ -n "$IP6" ]; then
	if [ "$IP" = "auto" ]; then
		ifconfig $IFACE accept_rtadv
	else
		ifconfig $IFACE inet6 $IP6
	fi
fi
for i in $ALIASES6; do
	ifconfig $IFACE inet6 alias $i
done

ifconfig $IFACE $OPTS up

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>