Skip to content

Instantly share code, notes, and snippets.

@muffix
Created December 1, 2021 11:13
Show Gist options
  • Save muffix/413eb849cac96b6b0cb665808439f79a to your computer and use it in GitHub Desktop.
Save muffix/413eb849cac96b6b0cb665808439f79a to your computer and use it in GitHub Desktop.
Checks the Ubiquiti store for availability of the Dream Router
#!/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
@kerns
Copy link

kerns commented Jun 6, 2022

Has it ever become available, even briefly, since you wrote this? 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment