[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kolab-commits
Subject:    richard: server/kolabconf/lib/Kolab Conf.pm,1.14,1.15
From:       cvs () kolab ! org
Date:       2008-08-20 20:14:05
Message-ID: 20080820201405.14AB9600BA8 () lists ! intevation ! de
[Download RAW message or body]

Author: richard

Update of /kolabrepository/server/kolabconf/lib/Kolab
In directory doto:/tmp/cvs-serv19064/lib/Kolab

Modified Files:
	Conf.pm 
Log Message:
Added function bootstrapConfig to create config
files needed during kolab bootstrapping, see kolab/issue1755



Index: Conf.pm
===================================================================
RCS file: /kolabrepository/server/kolabconf/lib/Kolab/Conf.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- Conf.pm	9 Aug 2008 09:42:38 -0000	1.14
+++ Conf.pm	20 Aug 2008 20:14:03 -0000	1.15
@@ -703,6 +703,43 @@
     }
 }
 
+sub bootstrapConfig
+{
+    my $templatedir = $Kolab::config{"templatedir"};
+
+    # FIXME: it would be better if the templates can be given as an
+    # argument to this function.
+    my @templ = ("$templatedir/slapd.access.template",
+      "$templatedir/slapd.conf.template",
+      "$templatedir/slapd.replicas.template");
+ 
+    my %runonchange;
+
+    loadMetaTemplates( $templatedir, \%templates, \%permissions, \%ownership, \%runonchange );
+
+    my $cfg;
+    my $out;
+    foreach my $tpl (@templ) {
+      $cfg = $templates{$tpl};
+      # print STDOUT "Rebuilding $tpl => $cfg\n";
+      build($tpl, $cfg, $ownership{$cfg}, $permissions{$cfg} );
+
+      if ($tpl eq "$templatedir/slapd.conf.template") {
+        # Update file in place
+        if (open (CFG, "+< $cfg" )) {
+          while (<CFG>) {
+            s/^TLSCertificate/#TLSCertificate/;
+            $out .= $_;
+          }
+          seek(CFG, 0, 0);
+          print CFG $out;
+          truncate(CFG, tell(CFG));
+          close(CFG);
+	}
+      }
+    }
+}
+
 sub checkPermissions {
     my $key;
     my $value;


_______________________________________________
Kolab-commits mailing list
Kolab-commits@kolab.org
https://kolab.org/mailman/listinfo/kolab-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic