renamed mkEvents.csh to fetchEvents.sh, set default values

default values:
* starttime ($1): 6 month ago if date / gdate works, today otherwise
* output file ($2): stdout
This commit is contained in:
Kasper D. Fischer 2021-10-17 13:07:26 +02:00
parent dc1df224cc
commit 938452b898
2 changed files with 14 additions and 4 deletions

14
scripts/fetchEvents.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
# get starting date
# find gdate or date command ( OSX: brew install coreutils)
# the date command on OSX is not compatible to the linux date command
datecmd=$((which gdate || which date )| grep bin)
STIME="${1:-$(${datecmd} -d 6-month-ago +%Y-%m-%d)}"
STIME="${STIME:-$(date +%Y-%m-%d)}"
# get output filename
OUTPUT="${2:--}"
# fetch events
curl -s -o ${OUTPUT} "https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?starttime=${STIME}&minlat=50.0&maxlat=53.0&minlon=4.0&maxlon=10.0&minmag=0.7"

View File

@ -1,4 +0,0 @@
#!/bin/bash
STIME=$1
curl -o events.xml "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?starttime=${STIME}&orderby=time&minlat=50.92&maxlat=52.76&minlon=4.26&maxlon=9.74&minmag=1.1"