X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/7b9bf6ef0f3f579947bb613da9ae648327fd7923..388687b7120815bc61f49de6c5dd0ea793dad67b:/cookbooks/planet/templates/default/planet-update-file.erb?ds=sidebyside diff --git a/cookbooks/planet/templates/default/planet-update-file.erb b/cookbooks/planet/templates/default/planet-update-file.erb new file mode 100644 index 000000000..36786e232 --- /dev/null +++ b/cookbooks/planet/templates/default/planet-update-file.erb @@ -0,0 +1,30 @@ +#!/bin/sh + +# DO NOT EDIT - This file is being maintained by Chef + +# setup + +PLANETDIR="/var/lib/planet" +PLANETPREV="${PLANETDIR}/planet-previous.pbf" +PLANETCURR="${PLANETDIR}/planet.pbf" +PLANETNEW="${PLANETDIR}/planet-new.pbf" +PLANETTMP="${PLANETDIR}/planet-tmp.pbf" + +pyosmium-up-to-date -v -o "$PLANETNEW" "$PLANETCURR" +retval=$? + +while [ $retval -eq 1 ]; do + mv "$PLANETNEW" "$PLANETTMP" + pyosmium-up-to-date -v -o "$PLANETNEW" "$PLANETTMP" + retval=$? + rm "$PLANETTMP" +done + +if [ $retval -ne 0 ]; then + exit $retval +fi + +# cleanup + +mv "$PLANETCURR" "$PLANETPREV" +mv "$PLANETNEW" "$PLANETCURR"