diff options
author | José JORGE [zezinho] <lists.jjorge@free.fr> | 2018-09-23 16:26:43 +0200 |
---|---|---|
committer | José JORGE [zezinho] <lists.jjorge@free.fr> | 2018-09-23 16:26:43 +0200 |
commit | dec711a7b970c4e71872a5842522eefba9fda6b7 (patch) | |
tree | afe8c5c623613f4aa982cf72f4209d92b110a44d /lib/network | |
parent | 2836623d6b09bd9c4c8e07f7b2dd447abbd63f83 (diff) | |
download | drakx-net-dec711a7b970c4e71872a5842522eefba9fda6b7.tar drakx-net-dec711a7b970c4e71872a5842522eefba9fda6b7.tar.gz drakx-net-dec711a7b970c4e71872a5842522eefba9fda6b7.tar.bz2 drakx-net-dec711a7b970c4e71872a5842522eefba9fda6b7.tar.xz drakx-net-dec711a7b970c4e71872a5842522eefba9fda6b7.zip |
add IPv6 function to show IPv6 adress along with IPv4 in net_applet
Diffstat (limited to 'lib/network')
-rw-r--r-- | lib/network/tools.pm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/network/tools.pm b/lib/network/tools.pm index c8e0cf6..92e4765 100644 --- a/lib/network/tools.pm +++ b/lib/network/tools.pm @@ -272,6 +272,12 @@ sub get_interface_ip_address { $net->{ifcfg}{$interface}{IPADDR}; } +sub get_interface_ip6_address { + my ($net, $interface) = @_; + `/sbin/ip addr show dev $interface` =~ /^\s*inet6\s+(.*)\sscope\sglobal(.*)$/m && $1 || + $net->{ifcfg}{$interface}{IPADDR}; +} + sub get_interface_ptp_address { my ($interface) = @_; my ($flags, $_link, $addrs) = `/sbin/ip addr show dev $interface`; |