X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=a192ddcdb52ce0a9dd57cea299f64e57839606bb;hb=6019f8f8794b74483feacd01136bc5c888991bce;hp=b7049bf0595e0e7842e83f503d6423ea53c820df;hpb=0b427c0c03e09ecf0a3099318d5578419de74916;p=bacula-cn.git diff --git a/debian/postinst b/debian/postinst index b7049bf..a192ddc 100644 --- a/debian/postinst +++ b/debian/postinst @@ -181,9 +181,10 @@ send_mail() { return fi - umask 077 + umask 022 chmod 0700 $GPG_HOME echo Generating request in $REQUEST_FILE + rm -f $REQUEST_FILE # Header cat > $REQUEST_FILE <> $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 +295,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 +314,8 @@ case "$1" in restart_bacula send_mail + + db_stop ;; abort-upgrade|abort-remove|abort-deconfigure)