diff options
| author | Petter Reinholdtsen <pere@hungry.com> | 2006-12-03 14:42:04 +0000 | 
|---|---|---|
| committer | Petter Reinholdtsen <pere@hungry.com> | 2006-12-03 14:42:04 +0000 | 
| commit | 1b6b2856a0ed353591be57ef371e529aad877776 (patch) | |
| tree | d721da96fe1d7ce29f6c10cf9361c449efd3ad5a | |
| parent | 2946b7f62e07ef641a64e6b3104bf88d1a9ff5ea (diff) | |
| download | sitesummary-1b6b2856a0ed353591be57ef371e529aad877776.tar.gz sitesummary-1b6b2856a0ed353591be57ef371e529aad877776.tar.bz2 sitesummary-1b6b2856a0ed353591be57ef371e529aad877776.tar.xz  | |
  * Change the collector to use the mac address from eth1 or eth2 if
    eth0 isn't usable.
| -rw-r--r-- | debian/changelog | 2 | ||||
| -rw-r--r-- | sitesummary-collector.cgi | 7 | 
2 files changed, 8 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog index e1797a5..8f02ddf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,6 +8,8 @@ sitesummary (0.0.20) UNRELEASED; urgency=low      sure Getopt::Std is available for sitesummary-upload.    * Add new collect.d/debian to collect debian specific stuff.  Now      collects /etc/debian_version. +  * Change the collector to use the mac address from eth1 or eth2 if +    eth0 isn't usable.   -- Petter Reinholdtsen <pere@debian.org>  Sun, 19 Nov 2006 21:52:41 +0100 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 {  | 
