Skip to content

Instantly share code, notes, and snippets.

@tserong
Created September 19, 2022 10:59
Show Gist options
  • Save tserong/bf440ae2ec585bf0bb03bca56e7765da to your computer and use it in GitHub Desktop.
Save tserong/bf440ae2ec585bf0bb03bca56e7765da to your computer and use it in GitHub Desktop.
#!/bin/bash
HOME=${HOME:-/tmp}
WARNING_URL=ftp://ftp.bom.gov.au/anon/gen/fwo/IDT29000.txt
LAST_WARNING=$HOME/sheep-graziers-warning.last
NEXT_WARNING=$HOME/sheep-graziers-warning.next
rm -f $NEXT_WARNING
/usr/bin/curl -s -o $NEXT_WARNING $WARNING_URL
[ -e "$NEXT_WARNING" ] || exit 0
diff $LAST_WARNING $NEXT_WARNING >/dev/null 2>&1 && exit 0
cat $NEXT_WARNING
mv $NEXT_WARNING $LAST_WARNING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment