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 434536b1e9 - Show all commits

View file

@ -207,7 +207,19 @@ hook_db() {
hook_mail() {
MAIL_TEXTE=$(echo "${MESSAGE}" | sed -e "s@/@\\\\\/@g ; s@&@\\\\&@")
MAIL_GIT_COMMITS=$(echo "${GIT_COMMITS}" | sed -e "s@/@\\\\\/@g ; s@&@\\\\&@")
MAIL_CONTENT=$(sed -e "s/__TO__/${EVOMAINTMAIL}/ ; s/__HOSTNAME__/${HOSTNAME_TEXT}/ ; s/__USER__/${USER}/ ; s/__BEGIN_DATE__/${BEGIN_DATE}/ ; s/__END_DATE__/${END_DATE}/ ; s/__GIT_COMMITS__/${MAIL_GIT_COMMITS}/ ; s/__TEXTE__/${MAIL_TEXTE}/ ; s/__IP__/${IP}/ ; s/__FULLFROM__/${FULLFROM}/ ; s/__FROM__/${FROM}/ ; s/__URGENCYFROM__/${URGENCYFROM}/ ; s/__URGENCYTEL__/${URGENCYTEL}/" /usr/share/scripts/evomaintenance.tpl)
MAIL_CONTENT=$(sed -e "s/__TO__/${EVOMAINTMAIL}/" \
-e "s/__HOSTNAME__/${HOSTNAME_TEXT}/" \
-e "s/__USER__/${USER}/" \
-e "s/__BEGIN_DATE__/${BEGIN_DATE}/" \
-e "s/__END_DATE__/${END_DATE}/" \
-e "s/__GIT_COMMITS__/${MAIL_GIT_COMMITS}/" \
-e "s/__TEXTE__/${MAIL_TEXTE}/" \
-e "s/__IP__/${IP}/" \
-e "s/__FULLFROM__/${FULLFROM}/" \
-e "s/__FROM__/${FROM}/" \
-e "s/__URGENCYFROM__/${URGENCYFROM}/" \
-e "s/__URGENCYTEL__/${URGENCYTEL}/" \
/usr/share/scripts/evomaintenance.tpl)
if [ "${VERBOSE}" = "1" ]; then
printf "\n\n********** Mail *******************\n%s\n***********************************\n" "${MAIL_CONTENT}"