diff options
author | John Southworth <john.southworth@vyatta.com> | 2011-02-24 19:22:11 -0600 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2011-02-24 19:22:11 -0600 |
commit | ad9d59022276433d16f9dee0af9d4210868e777f (patch) | |
tree | e940949d04f7eeb84fadb4051f859ef0a61e3028 /scripts | |
parent | 41571d0527297afa817fd677b96df9c46b70d355 (diff) | |
download | vyatta-op-vpn-ad9d59022276433d16f9dee0af9d4210868e777f.tar.gz vyatta-op-vpn-ad9d59022276433d16f9dee0af9d4210868e777f.zip |
Make 'show vpn ipsec status' aware of the dhcp-interface option
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/vyatta-show-ipsec-status.pl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/vyatta-show-ipsec-status.pl b/scripts/vyatta-show-ipsec-status.pl index 1701bad..7ecce30 100644 --- a/scripts/vyatta-show-ipsec-status.pl +++ b/scripts/vyatta-show-ipsec-status.pl @@ -49,6 +49,16 @@ sub get_vpn_all_localips { @vpn_peers = $config->listOrigNodes('peer'); foreach my $peer (@vpn_peers) { my $local_ip = $config->returnOrigValue("peer $peer local-ip"); + if (!defined($local_ip)){ + my $dhcpif = $config->returnOrigValue("peer $peer dhcp-interface"); + if (defined($dhcpif)){ + $local_ip = (Vyatta::Misc::getIP($dhcpif, 4))[0]; + if (defined($local_ip)){ + $local_ip = (split(/\//,$local_ip))[0]; + } + } + $local_ip = ' ' if !defined($local_ip); + } push @local_ips, $local_ip; } return @local_ips; @@ -75,6 +85,8 @@ sub relate_intfs_with_localips { print "(no IP on interface statically configured as local-ip for any VPN peer)"; } print "\n"; + } else { + print "( )"; } } } |