diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-04-20 21:02:25 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-04-20 21:02:25 -0700 |
commit | 0115b0edf57af29f5c234031936c445c3bf5ac73 (patch) | |
tree | 0b9527203dfe19f585eea0cdacbc857b68ad57fe /scripts | |
parent | 0d5eba684254f37950583badc6d84b38b283afed (diff) | |
download | vyatta-cfg-0115b0edf57af29f5c234031936c445c3bf5ac73.tar.gz vyatta-cfg-0115b0edf57af29f5c234031936c445c3bf5ac73.zip |
Use getIP rather than call 'ip addr'
Trying to have uniform library to interface state.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-interfaces.pl | 8 |
1 files changed, 2 insertions, 6 deletions
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 { |