Created
December 1, 2021 11:13
-
-
Save muffix/413eb849cac96b6b0cb665808439f79a to your computer and use it in GitHub Desktop.
Checks the Ubiquiti store for availability of the Dream Router
This file contains hidden or 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/zsh | |
# Fill in your webhook here | |
WEBHOOK=https://httpbin.org/get | |
STORE_URL=https://eu.store.ui.com | |
while true; do | |
AVAILABLE=$(curl --silent ${STORE_URL}/products.json | jq '.products[] | select(.handle=="dream-router-ea").variants[0].available') | |
if [[ "${AVAILABLE}" == "true" ]]; then | |
echo "UDR available" | |
curl --silent ${WEBHOOK} 2> /dev/null | |
exit 0 | |
else | |
sleep 15 | |
fi | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Has it ever become available, even briefly, since you wrote this? 😂