Touch up wait4ifup more

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5216 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-01-12 22:04:14 +00:00
parent 7094c04dfd
commit 3faa126201

View File

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