Skip to content

Instantly share code, notes, and snippets.

@xandout
Created March 16, 2020 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xandout/1f14a52b4d275b8bbdfc940f53eca9c7 to your computer and use it in GitHub Desktop.
Save xandout/1f14a52b4d275b8bbdfc940f53eca9c7 to your computer and use it in GitHub Desktop.
Check METRC API status
#!/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