mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-08 16:54:10 +01:00
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:
parent
7094c04dfd
commit
3faa126201
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user