diff options
author | Felix Fietkau <nbd@openwrt.org> | 2007-01-20 15:28:47 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2007-01-20 15:28:47 +0000 |
commit | ece171847fe117e1b69a3a4cebec2a7863b2c48b (patch) | |
tree | 64247e5b3ff25809b1379015e0000d829766f609 /package | |
parent | 2ff865da0541864d15abd6188909e5c36f49f35f (diff) | |
download | master-187ad058-ece171847fe117e1b69a3a4cebec2a7863b2c48b.tar.gz master-187ad058-ece171847fe117e1b69a3a4cebec2a7863b2c48b.tar.bz2 master-187ad058-ece171847fe117e1b69a3a4cebec2a7863b2c48b.zip |
ignore the bridge option if brctl is not available
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6145 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rwxr-xr-x | package/base-files/files/lib/network/config.sh | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/package/base-files/files/lib/network/config.sh b/package/base-files/files/lib/network/config.sh index ffce9f6aa3..e68223e277 100755 --- a/package/base-files/files/lib/network/config.sh +++ b/package/base-files/files/lib/network/config.sh @@ -88,21 +88,23 @@ setup_interface() { # Setup bridging case "$iftype" in bridge) - ifconfig "$iface" up 2>/dev/null >/dev/null - ifconfig "br-$config" 2>/dev/null >/dev/null && { - $DEBUG brctl addif "br-$config" "$iface" - return 0 - } || { - $DEBUG brctl addbr "br-$config" - $DEBUG brctl setfd "br-$config" 0 - $DEBUG brctl addif "br-$config" "$iface" - iface="br-$config" + [ -x /usr/sbin/brctl ] && { + ifconfig "$iface" up 2>/dev/null >/dev/null + ifconfig "br-$config" 2>/dev/null >/dev/null && { + $DEBUG brctl addif "br-$config" "$iface" + return 0 + } || { + $DEBUG brctl addbr "br-$config" + $DEBUG brctl setfd "br-$config" 0 + $DEBUG brctl addif "br-$config" "$iface" + iface="br-$config" - # need to bring up the bridge and wait a second for - # it to switch to the 'forwarding' state, otherwise - # it will lose its routes... - ifconfig "$iface" up - sleep 1 + # need to bring up the bridge and wait a second for + # it to switch to the 'forwarding' state, otherwise + # it will lose its routes... + ifconfig "$iface" up + sleep 1 + } } ;; esac |