Add evocheck execution
This commit is contained in:
parent
a36b0bed83
commit
def18270f1
|
@ -17,6 +17,8 @@ Options
|
||||||
--no-db disable the database hook
|
--no-db disable the database hook
|
||||||
--commit enable the commit hook (default)
|
--commit enable the commit hook (default)
|
||||||
--no-commit disable the commit hook
|
--no-commit disable the commit hook
|
||||||
|
--evocheck enable evocheck execution (default)
|
||||||
|
--no-evocheck disable evocheck execution
|
||||||
--auto use "auto" mode
|
--auto use "auto" mode
|
||||||
--no-auto use "manual" mode (default)
|
--no-auto use "manual" mode (default)
|
||||||
-v, --verbose increase verbosity
|
-v, --verbose increase verbosity
|
||||||
|
|
|
@ -40,6 +40,8 @@ Options
|
||||||
--no-db disable the database hook
|
--no-db disable the database hook
|
||||||
--commit enable the commit hook (default)
|
--commit enable the commit hook (default)
|
||||||
--no-commit disable the commit hook
|
--no-commit disable the commit hook
|
||||||
|
--evocheck enable evocheck execution (default)
|
||||||
|
--no-evocheck disable evocheck execution
|
||||||
--auto use "auto" mode
|
--auto use "auto" mode
|
||||||
--no-auto use "manual" mode (default)
|
--no-auto use "manual" mode (default)
|
||||||
-v, --verbose increase verbosity
|
-v, --verbose increase verbosity
|
||||||
|
@ -130,6 +132,20 @@ get_repository_status() {
|
||||||
unset GIT_DIR GIT_WORK_TREE
|
unset GIT_DIR GIT_WORK_TREE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get_evocheck() {
|
||||||
|
if [ -x "${EVOCHECK_BIN}" ]; then
|
||||||
|
printf "Evocheck status :"
|
||||||
|
EVOCHECK_OUT=$(${EVOCHECK_BIN})
|
||||||
|
EVOCHECK_RC=$?
|
||||||
|
|
||||||
|
if [ "${EVOCHECK_RC}" = "0" ] && [ -z "${EVOCHECK_OUT}" ]; then
|
||||||
|
printf " OK\n\n"
|
||||||
|
else
|
||||||
|
printf " ERROR\n%s\n\n" "${EVOCHECK_OUT}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
print_log() {
|
print_log() {
|
||||||
printf "*********** %s ***************\n" "$(get_now)"
|
printf "*********** %s ***************\n" "$(get_now)"
|
||||||
print_session_data
|
print_session_data
|
||||||
|
@ -282,6 +298,7 @@ HOOK_MAIL=${HOOK_MAIL:-"1"}
|
||||||
DRY_RUN=${DRY_RUN:-"0"}
|
DRY_RUN=${DRY_RUN:-"0"}
|
||||||
VERBOSE=${VERBOSE:-"0"}
|
VERBOSE=${VERBOSE:-"0"}
|
||||||
AUTO=${AUTO:-"0"}
|
AUTO=${AUTO:-"0"}
|
||||||
|
EVOCHECK=${EVOCHECK:-"1"}
|
||||||
GIT_STATUS_MAX_LINES=${GIT_STATUS_MAX_LINES:-20}
|
GIT_STATUS_MAX_LINES=${GIT_STATUS_MAX_LINES:-20}
|
||||||
|
|
||||||
# initialize variables
|
# initialize variables
|
||||||
|
@ -412,6 +429,8 @@ if [ -z "${PSQL_BIN}" ]; then
|
||||||
echo "No \`psql' command has been found, can't save to the database." 2>&1
|
echo "No \`psql' command has been found, can't save to the database." 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
EVOCHECK_BIN="/usr/share/scripts/evocheck.sh"
|
||||||
|
|
||||||
GIT_REPOSITORIES="/etc /etc/bind"
|
GIT_REPOSITORIES="/etc /etc/bind"
|
||||||
|
|
||||||
# initialize variable
|
# initialize variable
|
||||||
|
@ -437,6 +456,9 @@ else
|
||||||
fi
|
fi
|
||||||
readonly INTERACTIVE
|
readonly INTERACTIVE
|
||||||
|
|
||||||
|
if [ "${INTERACTIVE}" = "1" ] && [ "${EVOCHECK}" = "1" ]; then
|
||||||
|
get_evocheck
|
||||||
|
fi
|
||||||
if [ -n "${GIT_STATUSES}" ] && [ "${INTERACTIVE}" = "1" ]; then
|
if [ -n "${GIT_STATUSES}" ] && [ "${INTERACTIVE}" = "1" ]; then
|
||||||
printf "/!\ There are some uncommited changes.\n%s\n\n" "${GIT_STATUSES}"
|
printf "/!\ There are some uncommited changes.\n%s\n\n" "${GIT_STATUSES}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue