From 3faa126201e8a77acdf2225519315ca86b50a83d Mon Sep 17 00:00:00 2001 From: teastep Date: Fri, 12 Jan 2007 22:04:14 +0000 Subject: [PATCH] Touch up wait4ifup more git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5216 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall/wait4ifup | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Shorewall/wait4ifup b/Shorewall/wait4ifup index 74a93991c..a0c7d05d8 100755 --- a/Shorewall/wait4ifup +++ b/Shorewall/wait4ifup @@ -33,7 +33,7 @@ # interface_is_up() { - [ -n "$(ip link ls dev $1 | grep -e '[<,]UP[,>]')" ] + [ -n "$(ip link ls dev $1 2> /dev/null | grep -e '[<,]UP[,>]')" ] } case $# in @@ -49,11 +49,12 @@ case $# in ;; esac -while [ $timeout -gt 0 ] && ! interface_is_up $1; do +while [ $timeout -gt 0 ]; do + interface_is_up $1 && exit 0 sleep 1 timeout=$(( $timeout - 1 )) done -interface_is_up $1 +exit 1