mirror of
https://github.com/thegeeklab/wait-for.git
synced 2024-11-22 04:10:40 +00:00
commit
a93091b798
5
wait-for
5
wait-for
@ -20,14 +20,13 @@ USAGE
|
|||||||
}
|
}
|
||||||
|
|
||||||
wait_for() {
|
wait_for() {
|
||||||
command="$*"
|
|
||||||
for i in `seq $TIMEOUT` ; do
|
for i in `seq $TIMEOUT` ; do
|
||||||
nc -z "$HOST" "$PORT" > /dev/null 2>&1
|
nc -z "$HOST" "$PORT" > /dev/null 2>&1
|
||||||
|
|
||||||
result=$?
|
result=$?
|
||||||
if [ $result -eq 0 ] ; then
|
if [ $result -eq 0 ] ; then
|
||||||
if [ -n "$command" ] ; then
|
if [ $# -gt 0 ] ; then
|
||||||
exec $command
|
exec "$@"
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user