mirror of https://github.com/OpenIPC/firmware.git
				
				
				
			
		
			
				
	
	
		
			34 lines
		
	
	
		
			613 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
			
		
		
	
	
			34 lines
		
	
	
		
			613 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
| #!/bin/sh
 | |
| 
 | |
| # Configuration of the bridge should be done in /etc/network/interfaces.d/bridgeX
 | |
| # Read more at https://wiki.debian.org/BridgeNetworkConnections
 | |
| 
 | |
| [ ! -x /usr/sbin/brctl ] && exit 0
 | |
| 
 | |
| case "$IF_BRIDGE_PORTS" in
 | |
| 	"")
 | |
| 		exit 0
 | |
| 		;;
 | |
| 
 | |
| 	none)
 | |
| 		INTERFACES=""
 | |
| 		;;
 | |
| 
 | |
| 	all)
 | |
| 		INTERFACES=$(grep eth /proc/net/dev|sed 's/\(\ *\)\(eth[^:]*\)\(.*\)/\2/')
 | |
| 		;;
 | |
| 
 | |
| 	*)
 | |
| 		INTERFACES="$IF_BRIDGE_PORTS"
 | |
| 		;;
 | |
| esac
 | |
| 
 | |
| brctl addbr $IFACE &&
 | |
| 
 | |
| for i in $INTERFACES; do
 | |
| 	[ -x /etc/network/if-pre-up.d/vlan ] && env IFACE=$i /etc/network/if-pre-up.d/vlan
 | |
| 	brctl addif $IFACE $i && ip link set dev $i up
 | |
| done
 | |
| 
 | |
| brctl stp $IFACE off
 |