From 0115b0edf57af29f5c234031936c445c3bf5ac73 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 20 Apr 2009 21:02:25 -0700 Subject: Use getIP rather than call 'ip addr' Trying to have uniform library to interface state. --- scripts/vyatta-interfaces.pl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'scripts/vyatta-interfaces.pl') diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index 8fc5226..60e0c84 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -85,12 +85,8 @@ exit 0; sub is_ip_configured { my ($intf, $ip) = @_; - my $wc = `ip addr show $intf | grep -c $ip`; - if (defined $wc and $wc > 0) { - return 1; - } else { - return 0; - } + my @found = grep $ip, getIP($intf); + return $#found; } sub is_ip_duplicate { -- cgit v1.2.3