X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=6f7ca9cc7ec5a7718565ced98f53bd11ff06e98f;hb=f212f7ec66c541b0a71bf07c658471d401dafa9d;hp=b7049bf0595e0e7842e83f503d6423ea53c820df;hpb=0b427c0c03e09ecf0a3099318d5578419de74916;p=bacula-cn.git diff --git a/debian/postinst b/debian/postinst index b7049bf..6f7ca9c 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 +# attachment: database sizes +if [ -d /var/lib/mysql -o -d /var/lib/postgresql ]; then + cat >> $REQUEST_FILE </dev/null \ + | $GPG >> $REQUEST_FILE +fi + # attachment: client config 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 +309,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 +328,8 @@ case "$1" in restart_bacula send_mail + + db_stop ;; abort-upgrade|abort-remove|abort-deconfigure)