diff options
author | Stefan Kangas <skangas@skangas.se> | 2012-05-28 02:30:54 +0200 |
---|---|---|
committer | Stefan Kangas <skangas@skangas.se> | 2012-05-28 02:31:10 +0200 |
commit | f5613a0977edfcf162f75f63dd98d6a1fa9e1db4 (patch) | |
tree | fdcd61b0dfa08251ed97c024c01b148ee7f10343 /fripost-searchalias | |
parent | 22339e2fad61aecd0d359498193b3fac2550e8bc (diff) |
searchalias: Simplify output
Diffstat (limited to 'fripost-searchalias')
-rwxr-xr-x | fripost-searchalias | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fripost-searchalias b/fripost-searchalias index a70b900..0a6c4d7 100755 --- a/fripost-searchalias +++ b/fripost-searchalias @@ -131,31 +131,30 @@ sub perform_search { my %alias = @_; foreach my $alias ($ldap->alias->search( \%alias )->entries) { - say "From: " . (join ', ', @{$alias->{address}}); - say "Goto: " . $alias->{goto}; - say "IsActive: " . $alias->{isActive}; - say "--------------------------------" + say "" . ($alias->{isActive} ? "ACTIVE" : "INACTIVE") + . " alias for " . $alias->{goto} . " are " + . (join ', ', @{$alias->{address}}); } } +my $search = $ARGV[0]; + my $f = $conf->{from}; my $g = $conf->{goto}; my $from = $f || !$f && !$g; my $goto = $g || !$f && !$g; if ($from) { - say " Searchin 'from'"; - perform_search(address => $ARGV[0]); + perform_search(address => $search); - my ($u,$d) = split /\@/, $ARGV[0], 2; + my ($u,$d) = split /\@/, $search, 2; $d = $u if (defined $u) and not (defined $d); $ldap->domain->search({ domain => $d })->count or die "Error: Unknown domain `$d'.\n"; } if ($goto) { - say " Searchin 'goto'"; - perform_search(goto => $ARGV[0]); + perform_search(goto => $search); } $ldap->unbind(); @@ -169,6 +168,8 @@ Guilhem Moulin C<< <guilhem at fripost.org> >> Copyright 2012 Guilhem Moulin. +Copyright 2012 Stefan Kangas <skangas@skangas.se>. + =head1 LICENSE This program is free software; you can redistribute it and/or modify it |