File: //ibin/popreport.pl
nano #! /usr/bin/perl -w
$total_users = "0";
$total_domains = "0";
$total_found = "0";
print "=================================" . "\n";
while(<>) {
next if (/^#/);
if (/^(\S+)\s+/) {
$_ = $1;
# Detail - All Records
# print "\t" . $1 . "\n";
s/^.*@//;
# $dom{$_} = "";
$dom{lc($_)} = "";
$total_users ++;
# Detail - This contains each domain of each record
# print "\t" . $_ . "\n";
}
}
foreach $i (sort keys %dom) {
print "$i";
$total_found = system("grep -i " . $i . " /etc/passwd | wc -l");
$total_found = " " . $total_found;
# if ($total_found >= "1") {
# print "JACK-" . $i . "\n";
# }
$total_domains ++;
}
# Report Totals
#print "=================================" . "\n";
#print " Total Domains: " . $total_domains . "\n";
#print " Total Users: " . $total_users . "\n";
#$average = $total_users / $total_domains;
#print "Avg Per Domain: " . $average . "\n";
#kalexander :x :10526 :10526 :totalnurses4us.com :/home/mail/totalnurses4us.com/kalexander :/bin/false
#info.zo4life :x :11388 :11388 :zosfundforlife.org :/home/mail/zosfundforlife.org/info.zo4life :/bin/false