fix postinst with new function
authorZeljko Boros <Zeljko.Boros@carnet.hr>
Mon, 22 Mar 2021 10:31:52 +0000 (11:31 +0100)
committerZeljko Boros <Zeljko.Boros@carnet.hr>
Mon, 22 Mar 2021 10:31:52 +0000 (11:31 +0100)
debian/postinst

index a3d4150..693c254 100644 (file)
@@ -258,17 +258,20 @@ 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
+   # report problems
     if [ ! -e $REQUEST_FILE ]; then
         db_input high bacula-cn/request-failed || true
         db_go || true
     fi
 }
-
+   
+fix_privileges() {
+   # 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  
+}
 load_config() {
     db_get bacula-cn/hostname
     HOST=$RET
@@ -298,6 +301,8 @@ case "$1" in
         generate_fd_config
         generate_bconsole_config
 
+       fix_privileges
+
         restart_bacula
         send_request