ettore26 / wait-for-command Goto Github PK
View Code? Open in Web Editor NEWPosix sh compliant pure shell script which waits for a specific command exit status. Works in BusyBox.
License: MIT License
Posix sh compliant pure shell script which waits for a specific command exit status. Works in BusyBox.
License: MIT License
I'd love to see the behaviour similar to https://github.com/vishnubob/wait-for-it => enabling endless wait (for example for timeout == 0)
my command of interest:
docker inspect -f "{{.State.Health.Status}}" p6spy_postgresql_1 | grep -qw healthy
once running without wait-for-command.sh
I see:
docker inspect -f "{{.State.Health.Status}}" p6spy_postgresql_1 | grep -qw healthy && echo $?
0
So should be all fine, but using wait-for-command.sh
I see:
/tmp/wait-for-command.sh -t 1 -c 'docker inspect -f "{{.State.Health.Status}}" p6spy_postgresql_1 | grep -qw healthy'
wait-for-command.sh failed after 1 second(s).
cmd: docker inspect -f "{{.State.Health.Status}}" p6spy_postgresql_1 | grep -qw healthy
target exit status: 0
exited status: 125
Using a combination of wait-for-command.sh and another command as the command:
directive in a docker-compose file with an Alpine based image yields wait-for-command trying to use && as an argument.
command: wait-for-command.sh -c 'nc -z db 3306' && $command
wait-for-command.sh tries to utilize the && and the script breaks, uncertain if this is a shell or script issue.
Sorry I don't have an exact log on hand at the moment, if necessary will reproduce.
Current workaround: (installing bash already, so using it)
command: bash -c "sh -c \"./wait-for-command.sh -t 120 -c 'nc -z db 3306'\" && $command"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.