# HG changeset patch # User Tom Gottfried # Date 1475253168 -7200 # Node ID 4ce4bd48c26058c82bae7a9ae4aa16043df502e1 # Parent b5314ea024c6ab1e60636fac0042d210bb59f045 Avoid repeating potentially lengthy download of shapefiles. diff -r b5314ea024c6 -r 4ce4bd48c260 db_schema/setup-db.sh --- a/db_schema/setup-db.sh Fri Sep 30 17:41:31 2016 +0200 +++ b/db_schema/setup-db.sh Fri Sep 30 18:32:48 2016 +0200 @@ -81,12 +81,15 @@ echo create user $ROLE_NAME psql $DB_CONNECT_STRING -d $DB_NAME --command "CREATE SCHEMA geo AUTHORIZATION $ROLE_NAME" - TS="0101" + TS="0101" cd /tmp - curl -O http://sg.geodatenzentrum.de/web_download/vg/vg250_${TS}/utm32s/shape/vg250_${TS}.utm32s.shape.ebenen.zip && \ + if [ ! -f vg250_${TS}.utm32s.shape.ebenen.zip ]; then + curl -O \ + http://sg.geodatenzentrum.de/web_download/vg/vg250_${TS}/utm32s/shape/vg250_${TS}.utm32s.shape.ebenen.zip + fi unzip vg250_${TS}.utm32s.shape.ebenen.zip "*VG250_GEM*" cd vg250_${TS}.utm32s.shape.ebenen/vg250_ebenen/ shp2pgsql VG250_GEM geo.gem_utm | psql $DB_CONNECT_STRING -d $DB_NAME cd /tmp - rm -rf vg250_${TS}.utm32s.shape.ebenen* + rm -rf vg250_${TS}.utm32s.shape.ebenen fi