]> git.openstreetmap.org Git - chef.git/blob - cookbooks/planet/templates/default/planet-update-file.erb
Remove remains of long disabled streaming replication logic
[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 PLANETTMP="${PLANETDIR}/planet-tmp.${SUFFIX}"
14
15 pyosmium-up-to-date -v -o "$PLANETNEW" "$PLANETCURR"
16 retval=$?
17
18 while [ $retval -eq 1 ]; do
19     mv "$PLANETNEW" "$PLANETTMP"
20     pyosmium-up-to-date -v -o "$PLANETNEW" "$PLANETTMP"
21     retval=$?
22     rm "$PLANETTMP"
23 done
24
25 if [ $retval -ne 0 ]; then
26     exit $retval
27 fi
28
29 # cleanup
30
31 mv "$PLANETCURR" "$PLANETPREV"
32 mv "$PLANETNEW" "$PLANETCURR"