]> git.pld-linux.org Git - packages/lxd.git/commitdiff
- check if bridge is up and nothing more
authormis <mis@pld-linux.org>
Mon, 22 Aug 2016 12:11:23 +0000 (14:11 +0200)
committermis <mis@pld-linux.org>
Mon, 22 Aug 2016 12:11:23 +0000 (14:11 +0200)
lxdbr.init

index 65a7a33443d745d0029700e3efda34e30e1d4d2c..a638f4ac9219725496a6b861d5dbbc311efdfad9 100755 (executable)
@@ -29,7 +29,7 @@ if [ -z "$BRIDGE_DEV" -o -z "$BRIDGE_IPADDR" ]; then
 fi
 
 is_bridge_up() {
-       ip addr show $BRIDGE_DEV 2>/dev/null | grep -q $BRIDGE_IPADDR
+       ip link show $BRIDGE_DEV 2>/dev/null | grep -q ",UP,"
 }
 
 start() {
@@ -42,7 +42,7 @@ start() {
        busy
 
        ip link add dev $BRIDGE_DEV type bridge
-       ip a add $BRIDGE_IPADDR dev $BRIDGE_DEV
+       ip addr add $BRIDGE_IPADDR dev $BRIDGE_DEV
        ip link set up dev $BRIDGE_DEV
 
        if is_bridge_up; then
@@ -83,9 +83,10 @@ condrestart() {
 
 bridge_status() {
        local st="down"
-       if ip link show $BRIDGE_DEV >/dev/null; then
+       RETVAL=1
+       if is_bridge_up; then
                st="up"
-               RETVAL=1
+               RETVAL=0
        fi
        nls "lxd bridge %s is %s" "$BRIDGE_DEV" "$st"
 }
This page took 0.073355 seconds and 4 git commands to generate.