-
Notifications
You must be signed in to change notification settings - Fork 410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for HTTP status check with wget #14
Conversation
I just tried to use nc for this, but your solution is better.. |
@eficode Any way we could merge that? |
Hi @capripot , I tried using your adjusted script in an alpine image. Added |
Hi @triusis92. Just tried in the latest alpine the following docker run -it alpine sh
wget --timeout=1 -q "https://www.google.com" -O /dev/null > /dev/null 2>&1
echo $?
# 0
wget --timeout=1 -q "https://www.thatdoesntexist.com" -O /dev/null > /dev/null 2>&1
echo $?
# 1 So I believe the script should still work. Could you share your logs/output so I can help? |
Until this is merged I've created wait-for-cmd that can wait for any provided command (e.g. docker run --rm vitalets/wait-for-cmd 'wget --timeout=1 -q https://www.google.com -O /dev/null > /dev/null 2>&1' |
Thank you so much for this! |
# [2.1.0-beta.1](v2.0.0...v2.1.0-beta.1) (2021-02-16) ### Features * adds support for http using wget ([3758bab](3758bab)), closes [#14](#14)
Hi @capripot , sorry for taking so long to get back to you on your PR. I started working top-to-bottom from the list of PRs and by the time I reached yours there were some merge conflicts. Supporting http/https makes a lot of sense, so I'm happy that you worked on this. I created a new PR #34, which is mostly your work but with some changes here and there to make it all work with some other changes which recently landed. I'm first releasing #34 first as a beta, if anyone ends up using it, please share your experiences in that PR. Cheers! |
# [2.1.0](v2.0.0...v2.1.0) (2021-02-27) ### Features * adds support for http using wget ([ff0d29d](ff0d29d)), closes [#14](#14)
# 1.0.0 (2021-11-12) ### Bug Fixes * **command:** Restore environment variables before calling `exec` ([c7631e5](c7631e5)) * correctly render the command name in the help text ([d2bbce7](d2bbce7)), closes [#16](#16) * **iteration:** Remember to try one last time before giving up ([2ed5308](2ed5308)) * typo in error message for missing wget command ([db2479e](db2479e)) * uses timeout in nc as it is used with wget ([eficode#42](https://github.com/Andargor/wait-for/issues/42)) ([0195167](0195167)) ### Features * adds license header to wait-for script ([975d508](975d508)) * adds support for http using wget ([ff0d29d](ff0d29d)), closes [#14](#14) * **option:** Restrict the timeout input to non-negative integers ([c4d125f](c4d125f)) * **option:** Support more conventional formats in the option parser ([ce95717](ce95717)) * **version:** trigger first release for v1.0.0 ([33f1343](33f1343)) ### BREAKING CHANGES * **command:** HOST, PORT and other internally used environment variables are not overwritten anymore. If you use these, then you need to manually supply them.
# 1.0.0 (2022-02-06) ### Bug Fixes * **command:** Restore environment variables before calling `exec` ([c7631e5](c7631e5)) * correctly render the command name in the help text ([d2bbce7](d2bbce7)), closes [#16](#16) * **iteration:** Remember to try one last time before giving up ([2ed5308](2ed5308)) * **timeout:** resolve degredation which prevented setting indefinite timeout ([b45e76c](b45e76c)) * typo in error message for missing wget command ([db2479e](db2479e)) * uses timeout in nc as it is used with wget ([eficode#42](https://github.com/Shingaz/wait-for/issues/42)) ([0195167](0195167)) * wget timeout does not double ([206b38d](206b38d)) ### Features * adds -v and --version flag to show the version (Thanks [@philipp-kunz-mimacom](https://github.com/philipp-kunz-mimacom)) ([8636f50](8636f50)), closes [eficode#71](https://github.com/Shingaz/wait-for/issues/71) * adds license header to wait-for script ([975d508](975d508)) * adds support for http using wget ([ff0d29d](ff0d29d)), closes [#14](#14) * **option:** Restrict the timeout input to non-negative integers ([c4d125f](c4d125f)) * **option:** Support more conventional formats in the option parser ([ce95717](ce95717)) * **version:** trigger first release for v1.0.0 ([33f1343](33f1343)) ### BREAKING CHANGES * **command:** HOST, PORT and other internally used environment variables are not overwritten anymore. If you use these, then you need to manually supply them.
# 1.0.0 (2022-03-11) ### Bug Fixes * **command:** Restore environment variables before calling `exec` ([c7631e5](c7631e5)) * correctly render the command name in the help text ([d2bbce7](d2bbce7)), closes [#16](#16) * **http:** corrects protocol check for wget availability ([eficode#82](https://github.com/Penbase/wait-for/issues/82)) ([570c9fb](570c9fb)) * **iteration:** Remember to try one last time before giving up ([2ed5308](2ed5308)) * **timeout:** resolve degredation which prevented setting indefinite timeout ([b45e76c](b45e76c)) * typo in error message for missing wget command ([db2479e](db2479e)) * uses timeout in nc as it is used with wget ([eficode#42](https://github.com/Penbase/wait-for/issues/42)) ([0195167](0195167)) * wget timeout does not double ([206b38d](206b38d)) ### Features * adds -v and --version flag to show the version (Thanks [@philipp-kunz-mimacom](https://github.com/philipp-kunz-mimacom)) ([8636f50](8636f50)), closes [eficode#71](https://github.com/Penbase/wait-for/issues/71) * adds license header to wait-for script ([975d508](975d508)) * adds support for http using wget ([ff0d29d](ff0d29d)), closes [#14](#14) * **option:** Restrict the timeout input to non-negative integers ([c4d125f](c4d125f)) * **option:** Support more conventional formats in the option parser ([ce95717](ce95717)) * **version:** trigger first release for v1.0.0 ([33f1343](33f1343)) ### BREAKING CHANGES * **command:** HOST, PORT and other internally used environment variables are not overwritten anymore. If you use these, then you need to manually supply them.
# 1.0.0 (2022-12-21) ### Bug Fixes * **command:** Restore environment variables before calling `exec` ([c7631e5](c7631e5)) * correctly render the command name in the help text ([d2bbce7](d2bbce7)), closes [eficode#16](https://github.com/gesellix/wait-for/issues/16) * **http:** corrects protocol check for wget availability ([eficode#82](https://github.com/gesellix/wait-for/issues/82)) ([570c9fb](570c9fb)) * **iteration:** Remember to try one last time before giving up ([2ed5308](2ed5308)) * **timeout:** resolve degredation which prevented setting indefinite timeout ([b45e76c](b45e76c)) * typo in error message for missing wget command ([db2479e](db2479e)) * uses timeout in nc as it is used with wget ([eficode#42](https://github.com/gesellix/wait-for/issues/42)) ([0195167](0195167)) * wget timeout does not double ([206b38d](206b38d)) ### Features * adds -v and --version flag to show the version (Thanks [@philipp-kunz-mimacom](https://github.com/philipp-kunz-mimacom)) ([8636f50](8636f50)), closes [eficode#71](https://github.com/gesellix/wait-for/issues/71) * adds license header to wait-for script ([975d508](975d508)) * adds support for http using wget ([ff0d29d](ff0d29d)), closes [eficode#14](https://github.com/gesellix/wait-for/issues/14) * **option:** Restrict the timeout input to non-negative integers ([c4d125f](c4d125f)) * **option:** Support more conventional formats in the option parser ([ce95717](ce95717)) * **version:** trigger first release for v1.0.0 ([33f1343](33f1343)) ### BREAKING CHANGES * **command:** HOST, PORT and other internally used environment variables are not overwritten anymore. If you use these, then you need to manually supply them.
# 1.0.0 (2022-12-21) ### Bug Fixes * **command:** Restore environment variables before calling `exec` ([c7631e5](c7631e5)) * correctly render the command name in the help text ([d2bbce7](d2bbce7)), closes [eficode#16](https://github.com/gesellix/wait-for/issues/16) * **http:** corrects protocol check for wget availability ([eficode#82](https://github.com/gesellix/wait-for/issues/82)) ([570c9fb](570c9fb)) * **iteration:** Remember to try one last time before giving up ([2ed5308](2ed5308)) * **timeout:** resolve degredation which prevented setting indefinite timeout ([b45e76c](b45e76c)) * typo in error message for missing wget command ([db2479e](db2479e)) * uses timeout in nc as it is used with wget ([eficode#42](https://github.com/gesellix/wait-for/issues/42)) ([0195167](0195167)) * wget timeout does not double ([206b38d](206b38d)) ### Features * adds -v and --version flag to show the version (Thanks [@philipp-kunz-mimacom](https://github.com/philipp-kunz-mimacom)) ([8636f50](8636f50)), closes [eficode#71](https://github.com/gesellix/wait-for/issues/71) * adds license header to wait-for script ([975d508](975d508)) * adds support for http using wget ([ff0d29d](ff0d29d)), closes [eficode#14](https://github.com/gesellix/wait-for/issues/14) * **option:** Restrict the timeout input to non-negative integers ([c4d125f](c4d125f)) * **option:** Support more conventional formats in the option parser ([ce95717](ce95717)) * **version:** trigger first release for v1.0.0 ([4b9b12e](4b9b12e)) * **version:** trigger first release for v1.0.0 ([33f1343](33f1343)) ### BREAKING CHANGES * **command:** HOST, PORT and other internally used environment variables are not overwritten anymore. If you use these, then you need to manually supply them.
# 1.0.0 (2022-12-21) ### Bug Fixes * **command:** Restore environment variables before calling `exec` ([c7631e5](c7631e5)) * correctly render the command name in the help text ([d2bbce7](d2bbce7)), closes [eficode#16](https://github.com/gesellix/wait-for/issues/16) * **http:** corrects protocol check for wget availability ([eficode#82](https://github.com/gesellix/wait-for/issues/82)) ([570c9fb](570c9fb)) * **iteration:** Remember to try one last time before giving up ([2ed5308](2ed5308)) * **timeout:** resolve degredation which prevented setting indefinite timeout ([b45e76c](b45e76c)) * typo in error message for missing wget command ([db2479e](db2479e)) * uses timeout in nc as it is used with wget ([eficode#42](https://github.com/gesellix/wait-for/issues/42)) ([0195167](0195167)) * wget timeout does not double ([206b38d](206b38d)) ### Features * adds -v and --version flag to show the version (Thanks [@philipp-kunz-mimacom](https://github.com/philipp-kunz-mimacom)) ([8636f50](8636f50)), closes [eficode#71](https://github.com/gesellix/wait-for/issues/71) * adds license header to wait-for script ([975d508](975d508)) * adds support for http using wget ([ff0d29d](ff0d29d)), closes [eficode#14](https://github.com/gesellix/wait-for/issues/14) * **option:** Restrict the timeout input to non-negative integers ([c4d125f](c4d125f)) * **option:** Support more conventional formats in the option parser ([ce95717](ce95717)) * **version:** trigger first release for v1.0.0 ([4b9b12e](4b9b12e)) * **version:** trigger first release for v1.0.0 ([33f1343](33f1343)) ### BREAKING CHANGES * **command:** HOST, PORT and other internally used environment variables are not overwritten anymore. If you use these, then you need to manually supply them.
# 1.0.0 (2022-12-21) ### Bug Fixes * **command:** Restore environment variables before calling `exec` ([c7631e5](c7631e5)) * correctly render the command name in the help text ([d2bbce7](d2bbce7)), closes [eficode#16](https://github.com/gesellix/wait-for/issues/16) * **http:** corrects protocol check for wget availability ([eficode#82](https://github.com/gesellix/wait-for/issues/82)) ([570c9fb](570c9fb)) * **iteration:** Remember to try one last time before giving up ([2ed5308](2ed5308)) * **timeout:** resolve degredation which prevented setting indefinite timeout ([b45e76c](b45e76c)) * typo in error message for missing wget command ([db2479e](db2479e)) * uses timeout in nc as it is used with wget ([eficode#42](https://github.com/gesellix/wait-for/issues/42)) ([0195167](0195167)) * wget timeout does not double ([206b38d](206b38d)) ### Features * adds -v and --version flag to show the version (Thanks [@philipp-kunz-mimacom](https://github.com/philipp-kunz-mimacom)) ([8636f50](8636f50)), closes [eficode#71](https://github.com/gesellix/wait-for/issues/71) * adds license header to wait-for script ([975d508](975d508)) * adds support for http using wget ([ff0d29d](ff0d29d)), closes [eficode#14](https://github.com/gesellix/wait-for/issues/14) * **option:** Restrict the timeout input to non-negative integers ([c4d125f](c4d125f)) * **option:** Support more conventional formats in the option parser ([ce95717](ce95717)) * **version:** trigger first release for v1.0.0 ([33f1343](33f1343)) ### BREAKING CHANGES * **command:** HOST, PORT and other internally used environment variables are not overwritten anymore. If you use these, then you need to manually supply them.
# 1.0.0 (2023-01-08) ### Bug Fixes * **command:** Restore environment variables before calling `exec` ([c7631e5](c7631e5)) * correctly render the command name in the help text ([d2bbce7](d2bbce7)), closes [eficode#16](https://github.com/gesellix/wait-for/issues/16) * **http:** corrects protocol check for wget availability ([eficode#82](https://github.com/gesellix/wait-for/issues/82)) ([570c9fb](570c9fb)) * **iteration:** Remember to try one last time before giving up ([2ed5308](2ed5308)) * **timeout:** resolve degredation which prevented setting indefinite timeout ([b45e76c](b45e76c)) * typo in error message for missing wget command ([db2479e](db2479e)) * uses timeout in nc as it is used with wget ([eficode#42](https://github.com/gesellix/wait-for/issues/42)) ([0195167](0195167)) * wget timeout does not double ([206b38d](206b38d)) ### Features * adds -v and --version flag to show the version (Thanks [@philipp-kunz-mimacom](https://github.com/philipp-kunz-mimacom)) ([8636f50](8636f50)), closes [eficode#71](https://github.com/gesellix/wait-for/issues/71) * adds license header to wait-for script ([975d508](975d508)) * adds support for http using wget ([ff0d29d](ff0d29d)), closes [eficode#14](https://github.com/gesellix/wait-for/issues/14) * **option:** Restrict the timeout input to non-negative integers ([c4d125f](c4d125f)) * **option:** Support more conventional formats in the option parser ([ce95717](ce95717)) * **version:** trigger first release for v1.0.0 ([33f1343](33f1343)) ### BREAKING CHANGES * **command:** HOST, PORT and other internally used environment variables are not overwritten anymore. If you use these, then you need to manually supply them.
# 1.0.0 (2023-06-02) ### Bug Fixes * `wget` in alpine runs into an endless retry loop ([eficode#100](https://github.com/danieleagle/wait-for/issues/100)) ([b15c461](b15c461)) * **command:** Restore environment variables before calling `exec` ([c7631e5](c7631e5)) * correctly render the command name in the help text ([d2bbce7](d2bbce7)), closes [eficode#16](https://github.com/danieleagle/wait-for/issues/16) * **http:** corrects protocol check for wget availability ([eficode#82](https://github.com/danieleagle/wait-for/issues/82)) ([570c9fb](570c9fb)) * **iteration:** Remember to try one last time before giving up ([2ed5308](2ed5308)) * **timeout:** resolve degredation which prevented setting indefinite timeout ([b45e76c](b45e76c)) * typo in error message for missing wget command ([db2479e](db2479e)) * uses timeout in nc as it is used with wget ([eficode#42](https://github.com/danieleagle/wait-for/issues/42)) ([0195167](0195167)) * wget timeout does not double ([206b38d](206b38d)) ### Features * adds -v and --version flag to show the version (Thanks [@philipp-kunz-mimacom](https://github.com/philipp-kunz-mimacom)) ([8636f50](8636f50)), closes [eficode#71](https://github.com/danieleagle/wait-for/issues/71) * adds license header to wait-for script ([975d508](975d508)) * adds support for http using wget ([ff0d29d](ff0d29d)), closes [eficode#14](https://github.com/danieleagle/wait-for/issues/14) * **option:** Restrict the timeout input to non-negative integers ([c4d125f](c4d125f)) * **option:** Support more conventional formats in the option parser ([ce95717](ce95717)) * **version:** trigger first release for v1.0.0 ([33f1343](33f1343)) ### BREAKING CHANGES * **command:** HOST, PORT and other internally used environment variables are not overwritten anymore. If you use these, then you need to manually supply them.
# 1.0.0 (2023-12-09) ### Bug Fixes * `wget` in alpine runs into an endless retry loop ([eficode#100](https://github.com/fitz7/wait-for/issues/100)) ([b15c461](b15c461)) * **command:** Restore environment variables before calling `exec` ([c7631e5](c7631e5)) * correctly render the command name in the help text ([d2bbce7](d2bbce7)), closes [eficode#16](https://github.com/fitz7/wait-for/issues/16) * **http:** corrects protocol check for wget availability ([eficode#82](https://github.com/fitz7/wait-for/issues/82)) ([570c9fb](570c9fb)) * **iteration:** Remember to try one last time before giving up ([2ed5308](2ed5308)) * **timeout:** resolve degredation which prevented setting indefinite timeout ([b45e76c](b45e76c)) * typo in error message for missing wget command ([db2479e](db2479e)) * uses timeout in nc as it is used with wget ([eficode#42](https://github.com/fitz7/wait-for/issues/42)) ([0195167](0195167)) * wget timeout does not double ([206b38d](206b38d)) ### Features * adds -v and --version flag to show the version (Thanks [@philipp-kunz-mimacom](https://github.com/philipp-kunz-mimacom)) ([8636f50](8636f50)), closes [eficode#71](https://github.com/fitz7/wait-for/issues/71) * adds license header to wait-for script ([975d508](975d508)) * adds support for http using wget ([ff0d29d](ff0d29d)), closes [eficode#14](https://github.com/fitz7/wait-for/issues/14) * **option:** Restrict the timeout input to non-negative integers ([c4d125f](c4d125f)) * **option:** Support more conventional formats in the option parser ([ce95717](ce95717)) * **version:** trigger first release for v1.0.0 ([33f1343](33f1343)) ### BREAKING CHANGES * **command:** HOST, PORT and other internally used environment variables are not overwritten anymore. If you use these, then you need to manually supply them.
Add support for HTTP status check with
wget
, shipped with Alpine through busybox.Test if an API is up:
./wait-for http://www.eficode.com:80/ping -- echo "Eficode site is up"
Within a
docker-compose
file: