diff options
author | jules-vyos <vyos@ourhouse.org.uk> | 2017-07-03 14:24:44 +0100 |
---|---|---|
committer | jules-vyos <vyos@ourhouse.org.uk> | 2017-07-03 14:24:44 +0100 |
commit | ce1c285359947d4af3c2713482ba4927c29b93cd (patch) | |
tree | b7fcca4db50554f6a3e2ba51bd7e00cc55bb8a42 /scripts | |
parent | b1159f96a27fa39b8b3b71940efff602b468cf65 (diff) | |
download | vyatta-op-vpn-ce1c285359947d4af3c2713482ba4927c29b93cd.tar.gz vyatta-op-vpn-ce1c285359947d4af3c2713482ba4927c29b93cd.zip |
Fix for T319 - show vpn ipsec status returns incorrect information
Strongswan 'ipsec status' command changed output format.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/vyatta-show-ipsec-status.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/vyatta-show-ipsec-status.pl b/scripts/vyatta-show-ipsec-status.pl index a96d1dd..bff36c8 100644 --- a/scripts/vyatta-show-ipsec-status.pl +++ b/scripts/vyatta-show-ipsec-status.pl @@ -98,7 +98,10 @@ sub relate_intfs_with_localips { # my $process_id = `sudo cat /var/run/charon.pid`; -my $active_tunnels = `sudo ipsec status 2>/dev/null | grep 'newest IPsec SA: #' | grep -v 'newest IPsec SA: #0' | wc -l`; +# Update to deal with new strongswan syntax for ipsec status command. +my $sa_summary = `sudo ipsec status 2>/dev/null | grep "Security Associations" `; +my $active_tunnels; +($active_tunnels) = $sa_summary =~ /\((.*?) up/; chomp $process_id; chomp $active_tunnels; my @vpn_interfaces = get_vpn_intfs(); |