Created
March 16, 2020 14:59
-
-
Save xandout/1f14a52b4d275b8bbdfc940f53eca9c7 to your computer and use it in GitHub Desktop.
Check METRC API status
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
#!/bin/bash | |
declare -a metrcs=( | |
"https://api-ca.metrc.com" | |
"https://api-co.metrc.com" | |
"https://api-ma.metrc.com" | |
"https://api-mi.metrc.com" | |
"https://api-mt.metrc.com" | |
"https://api-nv.metrc.com" | |
"https://api-or.metrc.com" | |
"https://sandbox-api-ca.metrc.com" | |
"https://sandbox-api-co.metrc.com" | |
"https://sandbox-api-or.metrc.com" | |
) | |
for i in "${metrcs[@]}" | |
do | |
STATUS=$(curl -s -o /dev/null -w '%{http_code}' $i) | |
if [ $STATUS -eq 200 ]; then | |
echo "✔️ $i" | |
else | |
echo "❌ $i" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment