Skip to content

Instantly share code, notes, and snippets.

@ProMasoud
Created January 25, 2024 19:11
Show Gist options
  • Save ProMasoud/6b9052250959401d6082df29a64d5e38 to your computer and use it in GitHub Desktop.
Save ProMasoud/6b9052250959401d6082df29a64d5e38 to your computer and use it in GitHub Desktop.
A Simple shell for health check URLs
timestamp=$(date +%Y-%m-%d_%H-%M-%S)
link="https://"$1"/?health="
link+=$timestamp
echo $link
echo "Checking health ..."
if [ "$(curl --write-out "%{http_code}\n" --silent --output /dev/null $link )" == "200" ]; then
echo "All Good."
else
echo "Failed!"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment