Newer
Older
/usr/sbin/apache2ctl start
while true; do
Alessandro Cerioni
committed
result=`sudo -u nominatim ./src/build/utils/update.php --check-for-updates`
if [ "$result" = "Database up to date." ]; then
sleepy=300
echo "The Nominatim database in already up to date. Sleeping for ${sleepy}s..."
sleep $sleepy
else
Alessandro Cerioni
committed
curl http://photon:2322/api
isPhotonAlive=$?
Alessandro Cerioni
committed
if [ $isPhotonAlive -ne 0 ]; then
sleepy=300
echo "Photon is not available. Sleeping for ${sleepy}s, in order to let Photon wake up..."
sleep $sleepy
continue
fi
Alessandro Cerioni
committed
sudo -u nominatim ./src/build/utils/update.php --init-updates
sudo -u nominatim ./src/build/utils/update.php --import-osmosis --no-index
curl -v http://photon:2322/nominatim-update # this line triggers the Photon update following the Nominatim update
Alessandro Cerioni
committed
sleepy=1800
echo "Sleeping for ${sleepy}s, in order to let Photon update..."
sleep $sleepy
Alessandro Cerioni
committed
sudo -u nominatim ./src/build/utils/update.php --index
fi
Alessandro Cerioni
committed
done
#tail -f /var/log/postgresql/postgresql-9.5-main.log