X-Git-Url: http://ftp.carnet.hr/pub/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=932d18d00d0c72251605ad3cd743b6e51f98693f;hb=23cf33e754229c5e245c3ad19cefb5531b2b049b;hp=78a47ec55077a1dcca4bf1a3d8c08e227b32ce43;hpb=61a9b0bac4e17612f29bea434aaa39511942d0dd;p=bacula-cn.git diff --git a/debian/postinst b/debian/postinst index 78a47ec..932d18d 100644 --- a/debian/postinst +++ b/debian/postinst @@ -91,7 +91,7 @@ EOF generate_bconsole_config() { BCONSOLE_CONFIG=/etc/bacula/bconsole.conf - if [ -s $BCONSOLE_CONFIG ] && grep -q 'sysbackup-dir' $BCONSOLE_CONFIG; then + if [ -s $BCONSOLE_CONFIG ] && grep -q 'Console {' $BCONSOLE_CONFIG; then echo $BCONSOLE_CONFIG already exists, skipping. else umask 077 @@ -111,7 +111,7 @@ Director { Name = sysbackup-dir DIRport = 9101 address = sysbackup.carnet.hr - Password = "$PASS_BCONSOLE" + Password = "__INVALID__" # not used # you need these TLS entries so the bconsole and Director can communicate TLS Enable = yes @@ -120,6 +120,11 @@ Director { TLS Certificate = "/etc/bacula/bacula-fd.pem" TLS Key = "/etc/bacula/bacula-fd.pem" } + +Console { + Name = $HOST-acl + Password = "$PASS_BCONSOLE" +} EOF fi } @@ -231,7 +236,7 @@ Client { TLS Require = yes TLS CA Certificate File = "/etc/bacula/clients.d/$HOST-fd.pem" TLS Certificate = "/etc/bacula/bacula.pem" - TLS Key = "/etc/bacula/bacula.pem" + TLS Key = "/etc/bacula/bacula.key" } Job { @@ -265,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() { @@ -280,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 ) @@ -301,6 +313,8 @@ case "$1" in restart_bacula send_mail + + db_stop ;; abort-upgrade|abort-remove|abort-deconfigure)