Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Apple Pay Mexico
#!/bin/bash
#  Country code
CC="MX"
URL="https://smp-device-content.apple.com/static/region/v2/config.json"
HOME_PAGE="https://www.apple.com/mx/apple-pay"
FOUND=false
function check {
RET=$(curl -s $URL | jq .SupportedRegions.$CC)
([ $?==0 ] && echo $RET) || echo "null"
}
while [ $FOUND = false ]; do
R=$(check)
if [ "$R" != "null" ]; then
FOUND=true
echo -e "\a"
open $HOME_PAGE
open $URL
fi
sleep 5;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment