aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas <skangas@skangas.se>2012-05-28 02:36:33 +0200
committerStefan Kangas <skangas@skangas.se>2012-05-28 02:36:33 +0200
commitb04c0ff1b65ab9ce87fe64e44a15c1b09ce11b0e (patch)
treeb6f9e80b9692985f36de01f05d355b8fd89e3caf
parent118d9457d718c9011a85aa73321bc8eb3153e688 (diff)
searchdomain: simplify output
-rwxr-xr-xfripost-searchdomain16
1 files changed, 5 insertions, 11 deletions
diff --git a/fripost-searchdomain b/fripost-searchdomain
index 1507fea..cfd00ed 100755
--- a/fripost-searchdomain
+++ b/fripost-searchdomain
@@ -120,17 +120,11 @@ $domain{domain} = $ARGV[0] if defined $ARGV[0];
$domain{owner} = $ARGV[1] if defined $ARGV[1];
foreach my $domain ($ldap->domain->search( \%domain )->entries) {
- say "Domain: " . $domain->{domain};
- print "Owner: ";
- my $owners = $domain->{owner};
- if (defined $owners) {
- say (join ', ', @$owners);
- }
- else {
- say "(none)";
- }
- say "IsActive: " . $domain->{isActive};
- say "--------------------------------"
+ say '' . ($domain->{isActive} ? 'ACTIVE' : 'INACTIVE')
+ . ' domain ' . $domain->{domain}
+ . ' owned by '
+ . (defined $domain->{owner} ? join ', ', @{$domain->{owner}}
+ : '(none)');
}
$ldap->unbind();