diff options
Diffstat (limited to 'sitesummary-collector.cgi')
-rw-r--r-- | sitesummary-collector.cgi | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sitesummary-collector.cgi b/sitesummary-collector.cgi index bc5c712..c79190d 100644 --- a/sitesummary-collector.cgi +++ b/sitesummary-collector.cgi @@ -91,14 +91,19 @@ exit 0; sub extract_unique_id { my $eth0mac; + my $eth1mac; + my $eth2mac; open(IFCONFIG, "system/ifconfig-a") || die "Unable to read ifconfig-a"; while (<IFCONFIG>) { chomp; $eth0mac = $1 if (m/^eth0\s+Link encap:Ethernet HWaddr (\S+)/); + $eth1mac = $1 if (m/^eth1\s+Link encap:Ethernet HWaddr (\S+)/); + $eth2mac = $1 if (m/^eth2\s+Link encap:Ethernet HWaddr (\S+)/); } close (IFCONFIG); #print STDERR "MAC: $eth0mac\n"; - return "ether-$eth0mac"; + my $mac = $eth0mac || $eth1mac || $eth2mac || "unknown"; + return "ether-$mac"; } sub process_entry { |