Add options to enable/disable hooks (sending mail, commit /etc/.git, save to database…) #7

Merged
jlecour merged 61 commits from options into master 2019-03-26 15:14:12 +01:00
Showing only changes of commit 80087f3c38 - Show all commits

View file

@ -179,7 +179,7 @@ hook_commit() {
if [ -n "${GIT_COMMITS}" ]; then
if [ "${VERBOSE}" = "1" ]; then
printf "\n\n********** Commits ****************\n%s\n***********************************\n" "${GIT_COMMITS}"
printf "\n********** Commits ****************\n%s\n***********************************\n" "${GIT_COMMITS}"
fi
if [ "${DRY_RUN}" != "1" ]; then
echo "${GIT_COMMITS}" >> "${LOGFILE}"
@ -193,7 +193,7 @@ hook_db() {
PG_QUERY="INSERT INTO evomaint(hostname,userid,ipaddress,begin_date,end_date,details) VALUES ('${HOSTNAME}','${USER}','${IP}','${BEGIN_DATE}',now(),'${SQL_DETAILS}')"
if [ "${VERBOSE}" = "1" ]; then
printf "\n\n********** DB query **************\n%s\n***********************************\n" "${PG_QUERY}"
printf "\n********** DB query **************\n%s\n***********************************\n" "${PG_QUERY}"
fi
if [ "${DRY_RUN}" != "1" ]; then
echo "${PG_QUERY}" | psql "${PGDB}" "${PGTABLE}" -h "${PGHOST}"
@ -218,7 +218,7 @@ hook_mail() {
/usr/share/scripts/evomaintenance.tpl)
if [ "${VERBOSE}" = "1" ]; then
printf "\n\n********** Mail *******************\n%s\n***********************************\n" "${MAIL_CONTENT}"
printf "\n********** Mail *******************\n%s\n***********************************\n" "${MAIL_CONTENT}"
fi
if [ "${DRY_RUN}" != "1" ]; then
echo "${MAIL_CONTENT}" | ${SENDMAIL_BIN} -oi -t -f "${FROM}"