Skip to content

Instantly share code, notes, and snippets.

@rjchicago
Created February 27, 2023 14:58
Show Gist options
  • Save rjchicago/29c2cb4a1dfe796c676b458a68381f5c to your computer and use it in GitHub Desktop.
Save rjchicago/29c2cb4a1dfe796c676b458a68381f5c to your computer and use it in GitHub Desktop.
Test Endpoint
# create alias
test() {
local URL=${1:?URL is required as first argument}
local TIMEOUT=${TIMEOUT:-1}
local SLEEP=${SLEEP:-1}
while true; do curl -s -m $TIMEOUT $URL > /dev/null && echo -n ✅ || echo -n 💀; sleep $SLEEP; done
}
# usage
test my.example.asd/health
SLEEP=.1 TIMEOUT=.3 test my.example.asd/health
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment