X-Git-Url: http://lab.mitty.jp/git/?a=blobdiff_plain;f=bin%2Fget_ip_from_ifconfig.pl;fp=bin%2Fget_ip_from_ifconfig.pl;h=0000000000000000000000000000000000000000;hb=df4fa7ba97367054d8073e9f9626b28d8936d941;hp=ba6432d940496400d82d7fcef11b4d5d73123759;hpb=57d3e5400ce51f1881320585b520bc5f88f004ce;p=lab.git diff --git a/bin/get_ip_from_ifconfig.pl b/bin/get_ip_from_ifconfig.pl deleted file mode 100755 index ba6432d..0000000 --- a/bin/get_ip_from_ifconfig.pl +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/perl -use strict; -use Data::Dumper; - -my $interface; -my %IPs; - -foreach ( qx{ (LC_ALL=C /sbin/ifconfig -a 2>&1) } ) { - $interface = $1 if /^(\S+?):?\s/; - next unless defined $interface; - $IPs{$interface}->{STATE}=uc($1) if /\b(up|down)\b/i; - $IPs{$interface}->{IP}=$1 if /inet\D+(\d+\.\d+\.\d+\.\d+)/i; -} -print Dumper(\%IPs);