PUPPET_BASE="/opt/puppetlabs"
PUPPET_BIN="${PUPPET_BASE}/bin/puppet"
PUPPET_RUN_LOCK="${PUPPET_BASE}/puppet/cache/state/agent_catalog_run.lock"
+RETVAL="0"
if [[ -f "${BIN_DIR}/functions.rc" ]] ; then
. "${BIN_DIR}/functions.rc"
cmd+=" --noop"
fi
debug "Executing: ${cmd}"
+ set +e
eval ${cmd}
+ RETVAL="$?"
+ set -e
+
+ local rv_color="${RED}"
+ if [[ "${RETVAL}" == 0 ]] ; then
+ rv_color="${CYAN}"
+ elif [[ "${RETVAL}" == "1" || "${RETVAL}" == "2" ]] ; then
+ rv_color="${YELLOW}"
+ fi
empty_line
- info "${CYAN}Finished${NORMAL}."
+ info "${CYAN}Finished${NORMAL} with return value of ${rv_color}${RETVAL}${NORMAL}."
}
#------------------------------------------------------------------------------
}
main "$@"
-exit 0
+exit "${RETVAL}"
# vim: et list