Fix wait_for_bridge() in sysvinit script

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>
This commit is contained in:
Robert Vogelgesang 2014-04-04 19:01:34 +02:00 committed by Stéphane Graber
parent bfd483d43a
commit 3d3bc9ed7b

View File

@ -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