Skip to content

Instantly share code, notes, and snippets.

@christianroman
Created October 20, 2020 15:35
Show Gist options
  • Save christianroman/21415ae6f9dd07cae0b7327df8fc669d to your computer and use it in GitHub Desktop.
Save christianroman/21415ae6f9dd07cae0b7327df8fc669d to your computer and use it in GitHub Desktop.
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