Fix mail notification constant name

This commit is contained in:
Victor LABORIE 2017-01-18 10:33:02 +01:00
parent 60ccaaa2e2
commit 0296fab941
3 changed files with 12 additions and 8 deletions

16
bkctld
View File

@ -427,8 +427,10 @@ sub_inc() {
echo "Inc $date of $jail already exist !" >&2
fi
done
if [ -n "${incs_logs}" ]; then
echo "${incs_logs}" | mail -s "[info] EvoBackup - create incs" $MAIL
if [ -n "${NOTIF_MAIL}" ]; then
if [ -n "${incs_logs}" ]; then
echo "${incs_logs}" | mail -s "[info] EvoBackup - create incs" $NOTIF_MAIL
fi
fi
}
@ -443,8 +445,8 @@ sub_rm() {
echo "$0 rm always run (PID $pid) !" >&2
kill -9 $pid
rm $pidfile
if [ -n "${MAIL}" ]; then
echo "$0 rm $pid was killed by $$ !" | mail -s "[warn] EvoBackup - purge incs interrupted" $MAIL
if [ -n "${NOTIF_MAIL}" ]; then
echo "$0 rm $pid was killed by $$ !" | mail -s "[warn] EvoBackup - purge incs interrupted" $NOTIF_MAIL
fi
else
rm $pidfile
@ -481,8 +483,10 @@ sub_rm() {
done
rmdir $empty
rm $pidfile
if [ -n "${rms_logs}" ]; then
echo "${rms_logs}" | mail -s "[info] EvoBackup - purge incs" $MAIL
if [ -n "${NOTIF_MAIL}" ]; then
if [ -n "${rms_logs}" ]; then
echo "${rms_logs}" | mail -s "[info] EvoBackup - purge incs" $NOTIF_MAIL
fi
fi
}

View File

@ -10,4 +10,4 @@
#SSHD_CONFIG='/etc/ssh/sshd_config'
#AUTHORIZED_KEYS='/root/.ssh/authorized_keys'
#FIREWALL_RULES='/etc/firewall.rc.jails'
#MAIL='test@example.com'
#NOTIF_MAIL='test@example.com'

View File

@ -142,7 +142,7 @@ default : /var/log
Optionnals vars are no default value. No set them desactivate correspondant fonctionnality.
.RE
.PP
MAIL
NOTIF_MAIL
.RS 4
Mail address were notification mail will be set.
.RE