]> git.openstreetmap.org Git - chef.git/blob - cookbooks/cplanet/templates/default/update-planet.erb
Recipe to keep a local updated planet file.
[chef.git] / cookbooks / cplanet / templates / default / update-planet.erb
1 #!/bin/sh
2
3 # DO NOT EDIT - This file is being maintained by Chef
4
5 # setup
6
7 PLANETDIR="<%= @basedir %>/planet"
8 PLANETPREV="${PLANETDIR}/planet-previous.pbf"
9 PLANETCURR="${PLANETDIR}/planet.pbf"
10 PLANETNEW="${PLANETDIR}/planet-new.pbf"
11
12 retval=1
13 while [ $retval -eq 1 ]; do
14     pyosmium-up-to-date -v -o $PLANETNEW $PLANETCURR
15     retval=$?
16 done
17
18 if [ $retval -ne 0 ]; then
19     exit $retval
20 fi
21
22 # cleanup
23
24 mv "$PLANETCURR" "$PLANETPREV"
25 mv "$PLANETNEW" "$PLANETCURR"
26