diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2007-11-26 08:41:00 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2007-11-26 08:41:00 +0000 |
commit | d208fa88c746481025eeef8389bd71e6f9d27b09 (patch) | |
tree | d26030e3890bf2d6e094c6515e868a9c69cf06cc /site-summary | |
parent | 1242723c0bdbdef39a6b9bf9c95a070e9faa79c8 (diff) | |
download | sitesummary-d208fa88c746481025eeef8389bd71e6f9d27b09.tar.gz sitesummary-d208fa88c746481025eeef8389bd71e6f9d27b09.tar.bz2 sitesummary-d208fa88c746481025eeef8389bd71e6f9d27b09.tar.xz |
Typo.
Diffstat (limited to 'site-summary')
-rwxr-xr-x | site-summary | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/site-summary b/site-summary index e914719..61b5dc9 100755 --- a/site-summary +++ b/site-summary @@ -9,6 +9,7 @@ use Getopt::Std; my %sites; my %sitegroups; my %hostmap; +my %sitegroupmap; my %opts; sub usage { @@ -35,11 +36,10 @@ sub handle_host { my $sitegroup = get_sitegroup($hostid); if ($sitegroup) { $sitegroups{$site}{$sitegroup}++; - - if (exists $hostmap{$site}{$sitegroup}) { - push @{$hostmap{$site}{$sitegroup}}, $hostid ; + if (exists $sitegroupmap{$site} && exists $sitegroupmap{$site}{$sitegroup}) { + push @{$sitegroupmap{$site}{$sitegroup}}, $hostid ; } else { - $hostmap{$site}{$sitegroup} = [$hostid]; + $sitegroupmap{$site}{$sitegroup} = [$hostid]; } } else { if (exists $hostmap{$site}) { @@ -66,11 +66,11 @@ sub print_summary { for my $sitegroup (sort keys %{$sitegroups{$site}}) { printf(" %-18s %5d\n", $sitegroup, $sitegroups{$site}{$sitegroup}); if (exists $opts{l}) { - for my $hostid (sort @{$hostmap{$site}{$sitegroup}}) { + for my $hostid (sort @{$sitegroupmap{$site}{$sitegroup}}) { my $hostname = get_hostname($hostid); my $site = get_site($hostid) || ""; my $sitegroup = get_sitegroup($hostid) || ""; - printf " %s %s/%s %s\n", $hostname, $site, $sitegroup, $hostid; + printf " %s %s/%s %s\n", $hostname, $site, $sitegroup, $hostid; } } } |