From 4985e5d74100d470956d60c90134769c75641073 Mon Sep 17 00:00:00 2001 From: Valentin Vidic Date: Tue, 8 Mar 2011 14:11:43 +0100 Subject: [PATCH] Warn if request could not be sent. --- debian/po/templates.pot | 30 +++++++++++++++++++++++++++++- debian/postinst | 19 ++++++++++++++----- debian/templates | 11 +++++++++++ 3 files changed, 54 insertions(+), 6 deletions(-) diff --git a/debian/po/templates.pot b/debian/po/templates.pot index f16f8fc..7d4527c 100644 --- a/debian/po/templates.pot +++ b/debian/po/templates.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: bacula-cn@packages.debian.org\n" -"POT-Creation-Date: 2011-03-04 17:32+0100\n" +"POT-Creation-Date: 2011-03-08 14:10+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -71,3 +71,31 @@ msgid "" "backupa i za kontakt u slucaju problema. Zbog toga molimo da unesete radecu " "mail adresu." msgstr "" + +#. Type: error +#. Description +#: ../templates:4001 +msgid "Greska prilikom slanja zahtjeva." +msgstr "" + +#. Type: error +#. Description +#: ../templates:4001 +msgid "" +"Automatsko slanje zahtjeva za pokretanje usluge backupa posluzitelja nije " +"uspjelo. Zahtjev je spremljen u datoteci /etc/bacula/bacula-fd.txt" +msgstr "" + +#. Type: error +#. Description +#: ../templates:4001 +msgid "" +"Molimo prekopirajte navedenu datoteku na vas mail posluzitelj i posaljite ju " +"koristeci sljedecu naredbu:" +msgstr "" + +#. Type: error +#. Description +#: ../templates:4001 +msgid "/usr/sbin/sendmail -t < bacula-fd.txt" +msgstr "" diff --git a/debian/postinst b/debian/postinst index b7049bf..932d18d 100644 --- a/debian/postinst +++ b/debian/postinst @@ -270,9 +270,18 @@ cat >> $REQUEST_FILE </dev/null`" ]; then + echo Mailing request from $REQUEST_FILE + if sendmail -t -oi < $REQUEST_FILE; then + requestsent=1 + fi + fi + + if [ -z "$requestsent" ]; then + db_input high bacula-cn/mail-failed || true + db_go || true + fi } load_config() { @@ -285,8 +294,6 @@ load_config() { db_get bacula-cn/contact CONTACT=$RET - db_stop - PASS_FD=$( head -20 /dev/urandom | openssl dgst -sha1 ) PASS_BCONSOLE=$( head -20 /dev/urandom | openssl dgst -sha1 ) @@ -306,6 +313,8 @@ case "$1" in restart_bacula send_mail + + db_stop ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/templates b/debian/templates index ce763b4..07fe9c8 100644 --- a/debian/templates +++ b/debian/templates @@ -20,3 +20,14 @@ _Description: Kontakt adresa: Ova adresa koristit ce se prilikom slanja zahtjeva za pokretanje usluge backupa i za kontakt u slucaju problema. Zbog toga molimo da unesete radecu mail adresu. + +Template: bacula-cn/mail-failed +Type: error +_Description: Greska prilikom slanja zahtjeva. + Automatsko slanje zahtjeva za pokretanje usluge backupa posluzitelja + nije uspjelo. Zahtjev je spremljen u datoteci /etc/bacula/bacula-fd.txt + . + Molimo prekopirajte navedenu datoteku na vas mail posluzitelj i + posaljite ju koristeci sljedecu naredbu: + . + /usr/sbin/sendmail -t < bacula-fd.txt -- 1.7.10.4