ignore the bridge option if brctl is not available
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 20 Jan 2007 15:28:47 +0000 (15:28 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sat, 20 Jan 2007 15:28:47 +0000 (15:28 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6145 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/base-files/files/lib/network/config.sh

index ffce9f6..e68223e 100755 (executable)
@@ -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
This page took 0.037737 seconds and 4 git commands to generate.