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 | 857d350bc70160452b96bb423dd0396081ef30db (patch) | |
tree | 6eefab695d33a894712aec00946793fd546441e8 /package/base-files/files | |
parent | ee7132b9dfe0bec4c28952f60bf049a80a814e5a (diff) | |
download | mtk-20170518-857d350bc70160452b96bb423dd0396081ef30db.zip mtk-20170518-857d350bc70160452b96bb423dd0396081ef30db.tar.gz mtk-20170518-857d350bc70160452b96bb423dd0396081ef30db.tar.bz2 |
ignore the bridge option if brctl is not available
SVN-Revision: 6145
Diffstat (limited to 'package/base-files/files')
-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 ffce9f6..e68223e 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 |