summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjules-vyos <vyos@ourhouse.org.uk>2017-07-03 14:24:44 +0100
committerjules-vyos <vyos@ourhouse.org.uk>2017-07-03 14:24:44 +0100
commitce1c285359947d4af3c2713482ba4927c29b93cd (patch)
treeb7fcca4db50554f6a3e2ba51bd7e00cc55bb8a42
parentb1159f96a27fa39b8b3b71940efff602b468cf65 (diff)
downloadvyatta-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.
-rw-r--r--scripts/vyatta-show-ipsec-status.pl5
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();