X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;h=68f0916d34ed38034af6de0aad4b1a81509943dc;hb=a114cb6edf31ac9c685dee2ded75ff0af18e54c0;hp=b1bdf4684e4e077a195a10a9ff2e44be6f62232e;hpb=d4f02f986029849da61d0bf3a3466b589033aa4c;p=bacula-cn.git diff --git a/debian/postinst b/debian/postinst index b1bdf46..68f0916 100644 --- a/debian/postinst +++ b/debian/postinst @@ -170,7 +170,7 @@ restart_bacula() { } random_string() { - head -n 20 /dev/urandom | openssl dgst -sha1 + head -n 20 /dev/urandom | openssl dgst -sha1 | sed 's/^.* //' } send_mail() { @@ -247,29 +247,31 @@ EOF # Requested by $CONTACT on $DATE Client { Name = $HOST-fd + @/etc/bacula/include/client-debian-default.conf Address = $IP Password = "$PASS_FD" # password for bacula-fd(8) - @/etc/bacula/include/client-debian-default.conf - - TLS Enable = yes - 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.key" -} - -Job { - Name = "$HOST" - Client = $HOST-fd - JobDefs = "Job_SysBackup" } Console { Name = $HOST-acl + @/etc/bacula/include/acl-default.conf Password = "$PASS_BCONSOLE" # password for bconsole(8) JobACL = $HOST, RestoreFiles ClientACL = $HOST-fd - @/etc/bacula/include/acl-default.conf +} + +Job { + Name = "$HOST" + Client = $HOST-fd + JobDefs = "Job_TapeBackup" + Messages = messages-$HOST +} + +Messages { + Name = messages-$HOST + @/etc/bacula/include/messages-defaults.conf + mail = $EMAIL = all, !skipped } EOF @@ -292,7 +294,7 @@ EOF # Try to send it if [ -x "`which sendmail 2>/dev/null`" ]; then echo Mailing request from $REQUEST_FILE - if sendmail -t -oi < $REQUEST_FILE; then + if sendmail -t -oi -f "$EMAIL" < $REQUEST_FILE; then requestsent=1 fi fi @@ -312,6 +314,8 @@ load_config() { db_get bacula-cn/contact CONTACT=$RET + EMAIL=${CONTACT#*<} + EMAIL=${EMAIL%>*} PASS_FD=$( random_string ) PASS_BCONSOLE=$( random_string )