summaryrefslogtreecommitdiffstats
path: root/resources/config/1/uniontmp/etc/init.inactive/bridge-network-interface.conf
blob: d3f609751f947e5a12189239c75bd6a4ed231196 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# bridge-network-interface - configure a network bridge
#
# This service checks whether a physical network device that has been added
# is one of the ports in a bridge config, and if so, bring up the related
# bridge

description	"configure bridges for device"

start on net-device-added
stop on net-device-removed INTERFACE=$INTERFACE

instance $INTERFACE

pre-start script
	. /lib/bridge-utils/bridge-utils.sh

	mkdir -p /var/run/network
	for i in $(ifquery --list --allow auto); do
		ports=$(ifquery $i | sed -n -e's/^bridge_ports: //p')
		for port in $(bridge_parse_ports $ports); do
			case $port in
				$INTERFACE|$INTERFACE.*)
					ifup --allow auto $i
					brctl addif $i $port && ifconfig $port 0.0.0.0 up
					break
					;;
			esac
		done
	done
end script