]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix wait_for_bridge() in sysvinit script
authorRobert Vogelgesang <vogel@users.sourceforge.net>
Fri, 4 Apr 2014 17:01:34 +0000 (19:01 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 4 Apr 2014 21:45:35 +0000 (17:45 -0400)
Fix parsing of /etc/lxc/default.conf, i. e. ignore comments, and don't
require whitespace left and right of the equal sign.

Make the early return actually work.

Signed-off-by: Robert Vogelgesang <vogel@users.sourceforge.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
config/init/sysvinit/lxc

index 436eef488e086d44c60b3ac80aa7193060b292ab..5ab3c46567c70bc7b494efe060e6babc90fa7802 100755 (executable)
@@ -27,8 +27,10 @@ wait_for_bridge()
 {
     [ -f /etc/lxc/default.conf ] || { return 0; }
 
-    BRNAME=`grep lxc.network.link /etc/lxc/default.conf |awk '{print $3}'`
-    [ -n $BRNAME ] || { return 0; }
+    BRNAME=`grep '^[   ]*lxc.network.link' /etc/lxc/default.conf | sed 's/^.*=[        ]*//'`
+    if [ -z "$BRNAME" ]; then
+       return 0
+    fi
 
     for try in `seq 1 30`; do
        ifconfig -a |grep "^$BRNAME" >/dev/null 2>&1