projects
/
bacula-cn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support for new openssl versions (RT#140509).
[bacula-cn.git]
/
debian
/
postinst
diff --git
a/debian/postinst
b/debian/postinst
index
6f7ca9c
..
68f0916
100644
(file)
--- a/
debian/postinst
+++ b/
debian/postinst
@@
-169,11
+169,15
@@
restart_bacula() {
fi
}
fi
}
+random_string() {
+ head -n 20 /dev/urandom | openssl dgst -sha1 | sed 's/^.* //'
+}
+
send_mail() {
REQUEST_FILE=/etc/bacula/bacula-fd.txt
GPG_HOME=/var/lib/bacula-cn/gpg
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
GPG="gpg --homedir $GPG_HOME --batch --encrypt --armour --recipient rt@tt.carnet.hr --always-trust"
if [ -z "$CONFIG_CHANGED" ]; then
@@
-214,7
+218,7
@@
Content-Disposition: inline; filename="df.txt.gpg"
EOF
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
# attachment: database sizes
if [ -d /var/lib/mysql -o -d /var/lib/postgresql ]; then
@@
-243,29
+247,31
@@
EOF
# Requested by $CONTACT on $DATE
Client {
Name = $HOST-fd
# 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)
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 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
}
Console {
Name = $HOST-acl
+ @/etc/bacula/include/acl-default.conf
Password = "$PASS_BCONSOLE" # password for bconsole(8)
JobACL = $HOST, RestoreFiles
ClientACL = $HOST-fd
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
}
EOF
@@
-288,7
+294,7
@@
EOF
# Try to send it
if [ -x "`which sendmail 2>/dev/null`" ]; then
echo Mailing request from $REQUEST_FILE
# 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
requestsent=1
fi
fi
@@
-308,9
+314,11
@@
load_config() {
db_get bacula-cn/contact
CONTACT=$RET
db_get bacula-cn/contact
CONTACT=$RET
+ EMAIL=${CONTACT#*<}
+ EMAIL=${EMAIL%>*}
- PASS_FD=$( head -20 /dev/urandom | openssl dgst -sha1 )
- PASS_BCONSOLE=$( head -20 /dev/urandom | openssl dgst -sha1 )
+ PASS_FD=$( random_string )
+ PASS_BCONSOLE=$( random_string )
DATE=$( date '+%Y-%m-%d' )
DATE=$( date '+%Y-%m-%d' )