X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=5a45d4f4726ca5cf40650fd7996ab57866a973af;hb=76704136237b71819bea6552cbb84958d682536f;hp=a192ddcdb52ce0a9dd57cea299f64e57839606bb;hpb=7e6002ef77007d098c7e90ec060150f0a3eed71e;p=bacula-cn.git diff --git a/debian/postinst b/debian/postinst index a192ddc..5a45d4f 100644 --- a/debian/postinst +++ b/debian/postinst @@ -169,11 +169,15 @@ restart_bacula() { fi } +random_string() { + head -n 20 /dev/urandom | openssl dgst -sha1 +} + send_mail() { REQUEST_FILE=/etc/bacula/bacula-fd.txt GPG_HOME=/var/lib/bacula-cn/gpg - BOUNDARY=$( head -20 /dev/urandom | openssl dgst -sha1 ) + BOUNDARY=$( random_string ) GPG="gpg --homedir $GPG_HOME --batch --encrypt --armour --recipient rt@tt.carnet.hr --always-trust" if [ -z "$CONFIG_CHANGED" ]; then @@ -214,7 +218,21 @@ Content-Disposition: inline; filename="df.txt.gpg" EOF - df -h | $GPG >> $REQUEST_FILE + df -h | $GPG >> $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 <