Skip to content

Instantly share code, notes, and snippets.

@ZE3kr
Last active October 26, 2021 04:19
Show Gist options
  • Save ZE3kr/b0e1989110e0d0e5c1ef189144a44dcc to your computer and use it in GitHub Desktop.
Save ZE3kr/b0e1989110e0d0e5c1ef189144a44dcc to your computer and use it in GitHub Desktop.
#!/bin/bash
for (( ; ; )); do
mv new.json old.json 2> /dev/null
curl 'https://www.ems.com.cn/apple/getMailNoRoutes' --data-raw 'mailNum=EZ690XXXXXXCN' -s > new.json
DIFF_OUTPUT="$(diff new.json old.json)"
if [ "0" != "${#DIFF_OUTPUT}" ]; then
# Send notification here
echo "CHANGED"
fi
sleep 10
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment