We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
exec
1 parent 526918b commit 9964904Copy full SHA for 9964904
wait-for
@@ -1,5 +1,6 @@
1
#!/bin/sh
2
3
+set -- "$@" -- "$TIMEOUT" "$QUIET" "$HOST" "$PORT" "$result"
4
TIMEOUT=15
5
QUIET=0
6
@@ -30,7 +31,15 @@ wait_for() {
30
31
32
result=$?
33
if [ $result -eq 0 ] ; then
- if [ $# -gt 0 ] ; then
34
+ if [ $# -gt 6 ] ; then
35
+ for result in $(seq $(($# - 6))); do
36
+ result=$1
37
+ shift
38
+ set -- "$@" "$result"
39
+ done
40
+
41
+ TIMEOUT=$2 QUIET=$3 HOST=$4 PORT=$5 result=$6
42
+ shift 6
43
exec "$@"
44
fi
45
exit 0
@@ -47,8 +56,7 @@ wait_for() {
47
56
exit 1
48
57
}
49
58
50
-while [ $# -gt 0 ]
51
-do
59
+while :; do
52
60
case "$1" in
53
61
*:* )
54
62
HOST=$(printf "%s\n" "$1"| cut -d : -f 1)
0 commit comments