Changeset 385 for trunk


Ignore:
Timestamp:
Apr 24, 2019, 4:26:08 PM (5 years ago)
Author:
g7moreau
Message:
  • Add other mac address case (and update copyright)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ddt/ddt

    r368 r385  
    11#!/usr/bin/perl
    22#
    3 # Copyright (C) 2006-2018, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
     3# Copyright (C) 2006-2019, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
    44# License GNU GPL version 2 or later and Perl equivalent
    55#
     
    2121use strict;
    2222#use warnings;
    23 use version; our $VERSION = version->declare('0.12.0');
     23use version; our $VERSION = version->declare('0.12.1');
    2424
    2525use Getopt::Long qw(GetOptions);
     
    361361   my $mac_address = shift;
    362362
    363    # D07E-28D1-7AB8 or d07e28-d17ab8
     363   # D07E-28D1-7AB8 or d07e28-d17ab8 or D07E.28D1.7AB8
    364364   if ($mac_address =~ m{^ (?: [0-9A-Fa-f]{4} -){2} [0-9A-Fa-f]{4} $}xms
    365365      or $mac_address =~ m{^ [0-9A-Fa-f]{6} - [0-9A-Fa-f]{6} $}xms) {
    366366      $mac_address =~ s/-//g;
     367      return join q{:}, unpack('(A2)*', uc($mac_address));
     368      }
     369
     370   if ($mac_address =~ m{^ (?: [0-9A-Fa-f]{4} \.){2} [0-9A-Fa-f]{4} $}xms) {
     371      $mac_address =~ s/\.//g;
    367372      return join q{:}, unpack('(A2)*', uc($mac_address));
    368373      }
     
    33093314   print <<'END';
    33103315ddt - management of computer names and IP addresses
    3311 Copyright (C) 2006-2018, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
     3316Copyright (C) 2006-2019, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
    33123317Main author Gabriel Moreau <Gabriel.Moreau(A)univ-grenoble-alpes.fr>
    33133318License GNU GPL version 2 or later and Perl equivalent
     
    36563661License GNU GPL version 2 or later and Perl equivalent
    36573662
    3658 Copyright (C) 2006-2018, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
     3663Copyright (C) 2006-2019, LEGI UMR 5519 / CNRS UGA G-INP, Grenoble, France
Note: See TracChangeset for help on using the changeset viewer.