Code

Added Mac formatting rule.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Jan 2008 10:58:59 +0000 (10:58 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Jan 2008 10:58:59 +0000 (10:58 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8312 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/modules/ServerPackages.pm

index 9d4e95a7cfa63974aada8d443710e7a79c850ef5..62d70c8ac63c7f6fb7805b36049ee68a49836da2 100644 (file)
@@ -253,6 +253,8 @@ sub get_mac {
                        my ($if, $mac)= unpack 'h36 H12', $ifreq;
 
                        if (length($mac) > 0) {
+                               $mac=~ m/^([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])$/;
+                               $mac= sprintf("%s:%s:%s:%s:%s:%s", $1, $2, $3, $4, $5, $6);
                                $result = $mac
                        }
                }