diff options
author | Olivier Blin <oblin@mandriva.org> | 2005-06-09 13:59:03 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.org> | 2005-06-09 13:59:03 +0000 |
commit | 240d4c17d2696c23d23ef45cab63c847ffe4068b (patch) | |
tree | 514470e518732fc35487bcd6471bb3c736378033 /perl-install/network | |
parent | 6871614562699e7a121bb050fde450155650a770 (diff) | |
download | drakx-backup-do-not-use-240d4c17d2696c23d23ef45cab63c847ffe4068b.tar drakx-backup-do-not-use-240d4c17d2696c23d23ef45cab63c847ffe4068b.tar.gz drakx-backup-do-not-use-240d4c17d2696c23d23ef45cab63c847ffe4068b.tar.bz2 drakx-backup-do-not-use-240d4c17d2696c23d23ef45cab63c847ffe4068b.tar.xz drakx-backup-do-not-use-240d4c17d2696c23d23ef45cab63c847ffe4068b.zip |
add get_interface_ip_address (with bits from drakpxelinux)
Diffstat (limited to 'perl-install/network')
-rw-r--r-- | perl-install/network/tools.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index 220105a53..45c4eb4e6 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -224,4 +224,10 @@ sub get_default_metric { $idx * 10; } +sub get_interface_ip_address { + my ($net, $interface) = @_; + `/sbin/ip addr show dev $interface` =~ /^\s*inet\s+([\d.]+)/m && $1 || + $net->{ifcfg}{$interface}{IPADDR}; +} + 1; |