diff --git a/bkctld b/bkctld index 1339759..6d34994 100755 --- a/bkctld +++ b/bkctld @@ -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 } diff --git a/bkctld.conf b/bkctld.conf index cc951ab..ed93071 100644 --- a/bkctld.conf +++ b/bkctld.conf @@ -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' diff --git a/docs/bkctld.8 b/docs/bkctld.8 index cec9d94..7dcf8c5 100644 --- a/docs/bkctld.8 +++ b/docs/bkctld.8 @@ -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