make listen address and port configurable as first option
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 25 Mar 2009 21:24:33 +0000 (21:24 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 25 Mar 2009 21:24:33 +0000 (21:24 +0000)
bin/ldap-koha.pl
bin/ldap-rewrite.pl

index 40c64d6..e97e1ef 100755 (executable)
@@ -8,14 +8,14 @@ use IO::Socket;
 use lib 'lib';
 use LDAP::Koha;
 
-my $listen = '10.60.0.13:2389';
+my $listen = shift @ARGV || 'localhost:2389';
 
 my $sock = IO::Socket::INET->new(
        Listen => 5,
        Proto => 'tcp',
        Reuse => 1,
        LocalAddr => $listen,
-) || die;
+) || die "can't listen to $listen $!";
 
 warn "# listening on $listen";
 
index dd781c8..9c57242 100755 (executable)
@@ -20,7 +20,7 @@ use YAML qw/LoadFile/;
 
 my $config = {
        yaml_dir => './yaml/',
-       listen => 'localhost:1389',
+       listen => shift @ARGV || 'localhost:1389',
        upstream_ldap => 'ldap.ffzg.hr',
        upstream_ssl => 1,
        overlay_prefix => 'ffzg-',
@@ -99,7 +99,7 @@ sub log_response {
 
        if ( defined $response->{protocolOp}->{searchResEntry} ) {
                my $uid = $response->{protocolOp}->{searchResEntry}->{objectName};
-               warn "## SEARCH $uid";
+               warn "## objectName $uid";
 
                my @attrs;