steffen: server/kolabd/kolabd kolab_bootstrap,1.17,1.18

cvs at intevation.de cvs at intevation.de
Sat Jul 30 02:49:39 CEST 2005


Author: steffen

Update of /kolabrepository/server/kolabd/kolabd
In directory doto:/tmp/cvs-serv13852/kolabd

Modified Files:
	kolab_bootstrap 
Log Message:
Bootstrap fix for metaconf

Index: kolab_bootstrap
===================================================================
RCS file: /kolabrepository/server/kolabd/kolabd/kolab_bootstrap,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- kolab_bootstrap	22 Jul 2005 22:36:14 -0000	1.17
+++ kolab_bootstrap	30 Jul 2005 00:49:37 -0000	1.18
@@ -389,7 +389,15 @@
       my $tmpl = IO::File->new("$kolab_prefix/etc/kolab/templates/slapd.conf.template", "r") || die "could not read $kolab_prefix/etc/kolab/templates/slapd.conf.template";
       my $slpd = IO::File->new("$kolab_prefix/etc/openldap/slapd.conf","w+") || die "could not write to $kolab_prefix/etc/openldap/slapd.conf";
       chmod (0640,"$kolab_prefix/etc/openldap/slapd.conf");
-      foreach (<$tmpl>) {
+      while (<$tmpl>) {
+        if (/^KOLAB_META_START$/) {
+	    my $found_end;
+	    while (!$found_end) {
+	        $_ = <$tmpl>;
+		$found_end = /^KOLAB_META_END$/;
+	    }
+	    $_ = <$tmpl>;
+	}
         s/\@\@\@base_dn\@\@\@/$base_dn/g;
         s/\@\@\@bind_dn\@\@\@/$bind_dn/g;
         s/\@\@\@bind_pw_hash\@\@\@/$bind_pw/g;
@@ -399,12 +407,44 @@
       undef $slpd;
       undef $tmpl;
 
+      my $tmplname = "$kolab_prefix/etc/kolab/templates/slapd.replicas.template";
       $confname = "$kolab_prefix/etc/openldap/slapd.replicas";
-      copy( "$kolab_prefix/etc/kolab/templates/slapd.replicas.template", $confname ) || die "Could not write $confname";
-      chmod (0640,$confname );
+      $tmpl = IO::File->new($tmplname, "r") || die "could not read $tmplname";
+      $slpd = IO::File->new($confname,"w+") || die "could not write to $confname";
+      chmod (0640,$confname);
+      while (<$tmpl>) {
+        if (/^KOLAB_META_START$/) {
+	    my $found_end;
+	    while (!$found_end) {
+	        $_ = <$tmpl>;
+		$found_end = /^KOLAB_META_END$/;
+	    }
+	    $_ = <$tmpl>;
+	}
+        print $slpd $_;
+      }
+      undef $slpd;
+      undef $tmpl;
+
+      $tmplname = "$kolab_prefix/etc/kolab/templates/slapd.access.template";
       $confname = "$kolab_prefix/etc/openldap/slapd.access";
-      copy( "$kolab_prefix/etc/kolab/templates/slapd.access.template", $confname ) || die "Could not write $confname";
-      chmod (0640,$confname );
+      $tmpl = IO::File->new($tmplname, "r") || die "could not read $tmplname";
+      $slpd = IO::File->new($confname,"w+") || die "could not write to $confname";
+      chmod (0640,$confname);
+      while (<$tmpl>) {
+        if (/^KOLAB_META_START$/) {
+	    my $found_end;
+	    while (!$found_end) {
+	        $_ = <$tmpl>;
+		$found_end = /^KOLAB_META_END$/;
+	    }
+	    $_ = <$tmpl>;
+	}
+        print $slpd $_;
+      }
+      undef $slpd;
+      undef $tmpl;
+
       # now we must startup slapd
       print "temporarily starting slapd\n";
       $ldap_uri = "ldap://127.0.0.1:389/";





More information about the commits mailing list