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=8333ea00a9fe608c90c20af12ea0c51548f66f4e;hp=ba6432d940496400d82d7fcef11b4d5d73123759;hpb=920ad9e17feea13643c407944f9452b03bd45b6e;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);