-r umjesto -f u skripti, chown i chmod u /etc/bacula
authorZeljko Boros <Zeljko.Boros@carnet.hr>
Wed, 17 Mar 2021 12:07:46 +0000 (13:07 +0100)
committerZeljko Boros <Zeljko.Boros@carnet.hr>
Wed, 17 Mar 2021 12:07:46 +0000 (13:07 +0100)
bacula-check-cert
bacula-cn
debian/postinst

index 2dc908c..3ada58c 100755 (executable)
@@ -3,7 +3,7 @@
 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!
index c228cca..f1945d8 100644 (file)
--- a/bacula-cn
+++ b/bacula-cn
@@ -1 +1 @@
-30 15 * * * bacula /usr/sbin/bacula-check-cert > /dev/null 2>&1
+30 08 * * * bacula /usr/sbin/bacula-check-cert > /dev/null 2>&1
index 4ca4ab5..a3d4150 100644 (file)
@@ -258,6 +258,10 @@ EOF
     # 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