--$BOUNDARY--
EOF
- # Send it
- echo Mailing request from $REQUEST_FILE
- sendmail -t -oi < $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
+ requestsent=1
+ fi
+ fi
+
+ if [ -z "$requestsent" ]; then
+ db_input high bacula-cn/mail-failed || true
+ db_go || true
+ fi
}
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 )
restart_bacula
send_mail
+
+ db_stop
;;
abort-upgrade|abort-remove|abort-deconfigure)