summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-20 21:02:25 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-20 21:02:25 -0700
commit0115b0edf57af29f5c234031936c445c3bf5ac73 (patch)
tree0b9527203dfe19f585eea0cdacbc857b68ad57fe /scripts
parent0d5eba684254f37950583badc6d84b38b283afed (diff)
downloadvyatta-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-xscripts/vyatta-interfaces.pl8
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 {