ispman/bin ispman.ldifupdate,1.2,1.3

Joerg Delker <[email protected]>
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/bin
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv2455/bin

Modified Files:
	ispman.ldifupdate 
Log Message:
recoded for online LDAP check

Index: ispman.ldifupdate
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.ldifupdate,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ispman.ldifupdate	4 Oct 2004 21:18:07 -0000	1.2
+++ ispman.ldifupdate	26 May 2006 21:47:35 -0000	1.3
@@ -1,4 +1,5 @@
 #!/usr/bin/perl
+package ISPMan;
 
 # Script to update LDIF data
 # Reads from one ldif file and writes to another ldif
@@ -6,10 +7,6 @@
 
 # please adjust defines below to suit your environment
 
-# All entries are parsed (unless filtered with option "-b") and changed
-# according to current schema
[...1055 lines suppressed...]
+my $install_ldif = "cat $ispman->{'Config'}{'installDir'}/conf/ldif/ispman.ldif|".
+		   "$ispman->{'Config'}{'installDir'}/bin/ispman.substConf|";
+
+my $ldif=Net::LDAP::LDIF->new( $install_ldif );
+print STDERR "WARNING: Can't open $install_ldif" unless $ldif;
+
+print STDERR "\nChecking for missing ISPMan entries ...\n";
+$msg="";
+while ( not $ldif->eof() ) {
+    my $entry=$ldif->read_entry();
+    if (! $ispman->branchExists($entry->dn)) {
+       $msg .= "adding missing entry ".$entry->dn;
+       commit( $entry,$msg);
+    }
+}
+
+$OUT->done();
 
 __END__
 



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.