3 # DO NOT EDIT - This file is being maintained by Chef
5 date "+%c === Starting Nominatim update cycle"
9 <% if node[:nominatim][:enable_git_updates] -%>
10 if /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-source; then
12 if ! /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-refresh-db; then
13 date "+%c === Database refresh failed. Stopping updates."
17 pushd <%= @builddir %>
20 <% if node[:nominatim][:api_flavour] == "python" -%>
21 systemctl reload nominatim
26 if ! /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-data; then
27 date "+%c === Data update failed. Stopping updates."
31 date "+%c === Nominatim update cycle finished"
33 # sleep a bit if updates take less than a minute
35 elapsed=$((endtime - starttime))
36 if [[ $elapsed -lt 60 ]]; then
37 sleepy=$((60 - $elapsed))
38 date "+%c === Sleeping for ${sleepy}s..."