aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--SiteSummary.pm21
-rw-r--r--debian/changelog1
2 files changed, 22 insertions, 0 deletions
diff --git a/SiteSummary.pm b/SiteSummary.pm
index 944d964..054f78d 100644
--- a/SiteSummary.pm
+++ b/SiteSummary.pm
@@ -15,6 +15,7 @@ our @EXPORT = qw(
get_sitegroup
get_hostname
get_dns_address
+ get_macaddress
get_primary_macaddress
get_primary_ip_address
get_linux_kernel_ver
@@ -102,6 +103,26 @@ sub get_primary_ip_address {
}
#
+# Return all MAC addresses
+sub get_macaddress {
+ my $hostid = shift;
+ my $path = get_filepath_current($hostid, "/system/ifconfig-a");
+ if (open (FILE, $path)) {
+ my @macs;
+ while(<FILE>) {
+ chomp;
+ if (m/Link encap:Ethernet\s+HWaddr (\S+)\s+/) {
+ push(@macs, $1);
+ }
+ }
+ close(FILE);
+ return @macs;
+ } else {
+ return undef;
+ }
+}
+
+#
# Return the IP address on the primary network interface
#
sub get_primary_macaddress {
diff --git a/debian/changelog b/debian/changelog
index aa53ea8..5164bee 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ sitesummary (0.0.47) UNRELEASED; urgency=low
'update' argument when calling hook scripts on updates.
* Make sure to export the get_primary_ip_address function in the
SiteSummary perl module.
+ * Add perl function to return all ethernet MAC addresses.
* Add Swedish translation from Martin Ă…gren (Closes: #492067).
-- Petter Reinholdtsen <pere@debian.org> Mon, 28 Jul 2008 18:23:41 +0200