BACULACRT=/etc/bacula/bacula-fd.pem
DAYS=$(expr 30 \* 86400)
-if [ ! -f $BACULACRT ]; then
+if [ ! -r $BACULACRT ]; then
mailx -s "BACULA: Ne mogu otvoriti datoteku $BACULACRT!" -a 'Content-Type: text/plain; charset="utf-8"' root <<EOF
Datoteka $BACULACRT nije dostupna ili je korisnik 'bacula' ne može otvoriti!
-30 15 * * * bacula /usr/sbin/bacula-check-cert > /dev/null 2>&1
+30 08 * * * bacula /usr/sbin/bacula-check-cert > /dev/null 2>&1
# cleanup
rm -f $DF_FILE $DB_FILE $FD_FILE $PEM_FILE
+ ### fix privileges
+ chown root:bacula /etc/bacula/bacula-fd.pem /etc/bacula/bacula-fd.conf /etc/bacula/bconsole.conf
+ chmod 640 /etc/bacula/bacula-fd.pem /etc/bacula/bacula-fd.conf /etc/bacula/bconsole.conf
+
# report problems
if [ ! -e $REQUEST_FILE ]; then
db_input high bacula-cn/request-failed || true