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
11 pushd <%= @builddir %>
13 <% if node[:nominatim][:api_flavour] == "python" -%>
14 systemctl reload nominatim
17 if ! /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-refresh-db; then
18 date "+%c === Database refresh failed. Stopping updates."
24 if ! /sbin/runuser -u nominatim -- <%= @bindir %>/nominatim-update-data; then
25 date "+%c === Data update failed. Stopping updates."
29 date "+%c === Nominatim update cycle finished"
31 # sleep a bit if updates take less than a minute
33 elapsed=$((endtime - starttime))
34 if [[ $elapsed -lt 60 ]]; then
35 sleepy=$((60 - $elapsed))
36 date "+%c === Sleeping for ${sleepy}s..."