summaryrefslogtreecommitdiff
path: root/synopticChart.sh
diff options
context:
space:
mode:
authorSt33v <github@f3rr3t.com>2022-01-04 13:42:08 +1100
committerSt33v <github@f3rr3t.com>2022-01-04 13:42:08 +1100
commitb9fc59b5bde345ac7b628c715ce7d5f97ccdac3c (patch)
tree33240379d5afef958581d0a126dcff6621ab5d2b /synopticChart.sh
parenta3ccc194a12b041f5a6046124469330dd68b7193 (diff)
can download and convert when executed manually
Diffstat (limited to 'synopticChart.sh')
-rwxr-xr-xsynopticChart.sh15
1 files changed, 5 insertions, 10 deletions
diff --git a/synopticChart.sh b/synopticChart.sh
index 75d2ae2..b18b6e2 100755
--- a/synopticChart.sh
+++ b/synopticChart.sh
@@ -4,23 +4,18 @@
# See notes about BOM. they don't like scrapers but permit anon FTP
# for *personal use*
# This script will be called froma timer, once every 6 hours, which is
-# how oftern new charts are published.
+# how often new charts are published.
#
# The timer will take care of scheduing the call to the script
# todo: check what happens with daylight saving...
-# Construct current date and time
-# -u for UTC, just get the date portion.
-datePart=$(date -u +%Y%m%d)
+source func/deriveTimeString.sh
-# Now construct the 'time' pertion of the filename.
-# It is always 0000, 0600, 1200, or 1800
+dateTime=$(DeriveTime)
-timePart=0000
-currentchart=${datePart}-${timePart}
-latestChart=IDY00030.${datePart}${timePart}.pdf
+latestChart=IDY00030.${dateTime}.pdf
curl -o ${latestChart} ftp://ftp.bom.gov.au/anon/gen/fwo/${latestChart}
-convert -density 300 ${latestChart} ${currentchart}.png
+convert -density 300 ${latestChart} ${dateTime}.png