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