read ldap master from config file, if option --init or --delete; fix doc typos
authorarnold
Thu, 29 Nov 2012 13:52:00 +0100
changeset 1 36f66a013838
parent 0 a04ea5e7c15b
child 2 8ec2ac83a94c
read ldap master from config file, if option --init or --delete; fix doc typos
check_ldap_repl.pl
--- a/check_ldap_repl.pl	Thu Nov 29 12:12:29 2012 +0100
+++ b/check_ldap_repl.pl	Thu Nov 29 13:52:00 2012 +0100
@@ -17,12 +17,6 @@
 #
 #    Christian Arnold <arnold@schlittermann.de>
 
-# packages: libnet-ldap-perl
-# packages: libio-prompt-perl
-# packages: libio-socket-ssl-perl
-# packages: libconfig-inifiles-perl
-# packages: perl-doc (optional - for man page)
-
 use strict;
 use File::Basename;
 use Getopt::Long;
@@ -49,7 +43,7 @@
 
 my $ME      = basename $0;
 my $NAME    = "LDAPREPL";
-my $VERSION = "0.1";
+my $VERSION = "0.2";
 
 my %opt = (
 	init	=> 0,
@@ -157,6 +151,9 @@
 	if ( ($type eq "init") || ($type eq "delete") ) {
 		$binddn = prompt('BindDN: ');
 		$password = prompt('Password: ', -e => '*');
+		if (-r $opt{file}) {
+			(undef, undef, $master, undef, undef) = read_config();
+		}
 	} else {
 		if ($opt{binddn} && $opt{password}) {
 			$binddn = $opt{binddn};
@@ -309,13 +306,13 @@
 
 =item B<-i>|B<--init>
 
-Add the check object cn=replcheck,I<namingContext> to the master server if not existis. See also the B<--cn> option.
+Add the check object cn=replcheck,I<namingContext> to the master server if not exists. See also the B<--cn> option.
 You will ask for an B<binddn> and B<password>, if not given B<--binddn> and B<--password> options.
 Your B<binddn> must have write permission to the ldap master server.
 
 =item B<-d>|B<--delete>
 
-Delete the check object from the ldap master server if existis. See also the B<--cn> option.
+Delete the check object from the ldap master server if exists. See also the B<--cn> option.
 You will ask for an B<binddn> and B<password>, if not given B<--binddn> and B<--password> options.
 Your B<binddn> must have write permission to the ldap master server.
 
@@ -387,7 +384,7 @@
 
 =head1 VERSION
 
-This man page is current for version 0.1 of B<check_ldap_repl>.
+This man page is current for version 0.2 of B<check_ldap_repl>.
 
 =head1 AUTHOR