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