Exiting if there is no success.

This commit is contained in:
Roland 2022-03-09 20:42:05 -07:00
parent b7ae6aced0
commit 8fb7bf391b
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93

View file

@ -53,6 +53,7 @@ wget --continue https://download.geofabrik.de/north-america/us/district-of-colum
set +x
MAX_TRIES=3
COUNT=0
SUCCESS=false
while [ "${COUNT}" -lt "${MAX_TRIES}" ]; do
sudo -u wrolpi /bin/bash /opt/wrolpi/scripts/import_map.sh /tmp/district-of-columbia-latest.osm.pbf
dc_import=$?
@ -61,11 +62,17 @@ while [ "${COUNT}" -lt "${MAX_TRIES}" ]; do
sudo -u wrolpi /opt/openstreetmap-carto/scripts/get-external-data.py -d gis -U wrolpi
external_data=$?
if [[ "${dc_import}" == 0 && "${indexes}" == 0 && "${external_data}" == 0 ]]; then
SUCCESS=true
break
fi
((COUNT = COUNT + 1))
done
if [[ "${SUCCESS}" == false ]]; then
echo "Could not import map data"
exit 6
fi
cat >/usr/local/etc/renderd.conf <<'EOF'
[renderd]
num_threads=4