File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ usage() {
2323Usage:
2424 $cmdname host:port [-t timeout] [-- command args]
2525 -q | --quiet Do not output any status messages
26+ -s | --strict Only execute subcommand if the test succeeds
2627 -t TIMEOUT | --timeout=timeout Timeout in seconds, zero for no timeout
2728 -- COMMAND ARGS Execute command with args after the test finishes
2829USAGE
@@ -43,6 +44,12 @@ wait_for() {
4344 sleep 1
4445 done
4546 echo " Operation timed out" >&2
47+ if [ $result -ne 0 ] && [ $STRICT -ne 1 ] ; then
48+ if [ $# -gt 0 ] ; then
49+ exec " $@ "
50+ fi
51+ exit 0
52+ fi
4653 exit 1
4754}
4855
5865 QUIET=1
5966 shift 1
6067 ;;
68+ -s | --strict)
69+ STRICT=1
70+ shift 1
71+ ;;
6172 -t)
6273 TIMEOUT=" $2 "
6374 if [ " $TIMEOUT " = " " ]; then break ; fi
@@ -86,4 +97,6 @@ if [ "$HOST" = "" -o "$PORT" = "" ]; then
8697 usage 2
8798fi
8899
100+ STRICT=${STRICT:- 0}
101+
89102wait_for " $@ "
You can’t perform that action at this time.
0 commit comments