]> git.openstreetmap.org Git - chef.git/blob - cookbooks/planet/templates/default/planet-update-file.erb
mail: fix typo on community.openstreetmap.org domain
[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 SUFFIX="osh.pbf"
8
9 PLANETDIR="/var/lib/planet"
10 PLANETPREV="${PLANETDIR}/planet-previous.${SUFFIX}"
11 PLANETCURR="${PLANETDIR}/planet.${SUFFIX}"
12 PLANETNEW="${PLANETDIR}/planet-new.${SUFFIX}"
13
14 pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
15 retval=$?
16
17 while [ $retval -eq 1 ]; do
18     mv "$PLANETCURR" "$PLANETPREV"
19     mv "$PLANETNEW" "$PLANETCURR"
20     pyosmium-up-to-date -vvv -o "$PLANETNEW" "$PLANETCURR"
21     retval=$?
22 done
23
24 if [ $retval -ne 0 ]; then
25     exit $retval
26 fi
27
28 # cleanup
29
30 mv "$PLANETCURR" "$PLANETPREV"
31 mv "$PLANETNEW" "$PLANETCURR"