#!/bin/sh

# Use 'HOOK_WARN_TIMEOUT' or 'HOOK_KILL_TIMEOUT' *ABOVE THAT COMMENT* to specify a time after which a warning is emitted
# or the hook is interrupted.
# For example, 'HOOK_WARN_TIMEOUT' = 1 second (without quote, without text on the line after duration) will emit a warning if
# the hook takes more than one second to run.

# Hooks parameter are passed by environment variable:
#
# - RUDDER_GENERATION_DATETIME       : generation datetime: ISO-8601 YYYY-MM-ddTHH:mm:ss.sssZ date/time that identify that policy generation.
# - RUDDER_END_GENERATION_DATETIME   : generation end time: ISO-8601 YYYY-MM-ddTHH:mm:ss.sssZ date/time when the generation ended (minus these hooks)
# - RUDDER_NODE_IDS_PATH             : path to a sourceable file with variable RUDDER_NODE_IDS containing bash array of node id updated
#                                      during the process, or the empty array if no nodes were updated.
# - RUDDER_NUMBER_NODES_UPDATED      : integer >= 0; number of nodes updated (could be found by counting $RUDDER_NODE_IDS)
# - RUDDER_ROOT_POLICY_SERVER_UPDATED: 0 if root was updated, anything else if not

# Errors code on hooks are interpreted as follow:
# - 0     : success, no log (apart if debug one)          , continue to next hook
# - 1-31  : error  , error   log in /var/log/rudder/webapp/, stop processing
# - 32-63 : warning, warning log in /var/log/rudder/webapp/, continue to next hook
# - 64-255: reserved for future use case. Behavior may change without notice.

exit 0

