Created
January 25, 2024 19:11
-
-
Save ProMasoud/6b9052250959401d6082df29a64d5e38 to your computer and use it in GitHub Desktop.
A Simple shell for health check URLs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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