projects
/
bacula-cn.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a8debb9
)
Cleanup postinst.
author
Valentin Vidic
<Valentin.Vidic@CARNet.hr>
Mon, 14 Mar 2011 12:41:24 +0000
(13:41 +0100)
committer
Valentin Vidic
<Valentin.Vidic@CARNet.hr>
Mon, 14 Mar 2011 12:41:24 +0000
(13:41 +0100)
debian/postinst
patch
|
blob
|
history
diff --git
a/debian/postinst
b/debian/postinst
index
6f7ca9c
..
b1bdf46
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
+}
+
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
@@
-309,8
+313,8
@@
load_config() {
db_get bacula-cn/contact
CONTACT=$RET
db_get bacula-cn/contact
CONTACT=$RET
- 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' )