From a17eb6559e75b21796eb15409e4f4b50a0a06ad8 Mon Sep 17 00:00:00 2001 From: Roland Date: Mon, 14 Nov 2022 15:42:39 -0700 Subject: [PATCH] Simplifying map init script by using full path to dc map. --- scripts/initialize_map.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/initialize_map.sh b/scripts/initialize_map.sh index eaf6824c..54dc8dbd 100755 --- a/scripts/initialize_map.sh +++ b/scripts/initialize_map.sh @@ -9,9 +9,10 @@ set -x # Use D.C. to initialized DB because it is so small. DC_MAP=district-of-columbia-latest.osm.pbf -wget --continue https://download.geofabrik.de/north-america/us/${DC_MAP} -O /tmp/${DC_MAP} || : +DC_MAP_PATH=/tmp/${DC_MAP} +wget --continue https://download.geofabrik.de/north-america/us/${DC_MAP} -O ${DC_MAP_PATH} || : -if [ ! -f "/tmp/${DC_MAP}" ]; then +if [ ! -f "${DC_MAP_PATH}" ]; then echo "Could not download D.C. map" exit 2 fi @@ -32,7 +33,7 @@ while [ "${COUNT}" -lt "${MAX_TRIES}" ]; do -d gis -U wrolpi && external_data=true [[ "${dc_import}" = false ]] && - sudo -u wrolpi nice -n 18 /opt/wrolpi/scripts/import_map.sh /tmp/${DC_MAP} && + sudo -u wrolpi nice -n 18 /opt/wrolpi/scripts/import_map.sh ${DC_MAP_PATH} && dc_import=true [[ "${indexes}" = false ]] && sudo -u wrolpi psql -d gis -f /opt/openstreetmap-carto/indexes.sql &&