Elektrine lite

← Feed

@saxnot@chaos.social

Post #1386408

2026-04-19 12:55 UTC

linux utility which waits until [uri] responds with [http code] e. g. waiting for example.com/test, http 404 waiting for example.com/test, http 404 waiting for example.com/test, http 404 Hooray! Http 200 from example.com/test #sysop #devops #linux #cli #gnulinux #sysops #http

Replies (4)

  • @virtuous_sloth@cosocial.ca 2026-04-19 13:09

    @saxnot@chaos.social A simple shell command line? while ! curl "$url" | grep -q " $code "; do echo not yet; sleep 1; done; echo yep, now You'll have to adjust. For example, that regex might not be correct and you might need to add a 2>&1 to the curl to get the response code from stderr to stdout. Also, might want to add option to curl to only request headers.

    Open ##1386407

  • @saxnot@chaos.social 2026-04-19 12:56

    This somehow does not contain a question mark oops this is a question yes

    Open ##1635425

  • @snowyfox@deadinsi.de 2026-04-19 12:58

    .

    Open ##1635426

  • @fernsehmuell@chaos.social 2026-04-19 13:00

    @saxnot have a look at hurl (https://github.com/Orange-OpenSource/hurl) maybe you have to wrap it in a while loop i am not sure.

    Open ##1635427