[GRASS-SVN] r57756 - grass-promo/tutorials/batch_processing/earthquakes/NZ
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Sep 19 22:08:34 PDT 2013
Author: hamish
Date: 2013-09-19 22:08:33 -0700 (Thu, 19 Sep 2013)
New Revision: 57756
Modified:
grass-promo/tutorials/batch_processing/earthquakes/NZ/fetch_gns_earthquakes.sh
Log:
test if wget worked, quit with error if it didn't
Modified: grass-promo/tutorials/batch_processing/earthquakes/NZ/fetch_gns_earthquakes.sh
===================================================================
--- grass-promo/tutorials/batch_processing/earthquakes/NZ/fetch_gns_earthquakes.sh 2013-09-20 04:31:50 UTC (rev 57755)
+++ grass-promo/tutorials/batch_processing/earthquakes/NZ/fetch_gns_earthquakes.sh 2013-09-20 05:08:33 UTC (rev 57756)
@@ -35,6 +35,13 @@
wget -nv -O "$XMLNAME" "${URL}${REQUEST}&cql_filter=origintime>='$START_DATE'"
+if [ $? -ne 0 ] ; then
+ echo "Failed to download data from GNS." >&2
+ rm "$XMLNAME"
+ exit 1
+fi
+
+
BASE="wfs:FeatureCollection/wfs:member/geonet:quake"
FIELDS="
geonet:origintime
@@ -52,5 +59,5 @@
sed -e 's/T/|/' | grep -v '||' >> "$OUTFILE"
#todo: avoid the tmp file, just pipe from wget -O - | xml2 | 2csv | sed
-\rm "$XMLNAME"
+rm "$XMLNAME"
More information about the grass-commit
mailing list