From 32927e013922e1a79b0f214773e2500a1260871a Mon Sep 17 00:00:00 2001
From: Mohit Mehta <mohit.mehta@vyatta.com>
Date: Thu, 10 Dec 2009 17:19:18 -0800
Subject: fix show vpn commands to work with strongswan

---
 templates/show/vpn/ipsec/status/node.def | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

(limited to 'templates/show/vpn/ipsec/status/node.def')

diff --git a/templates/show/vpn/ipsec/status/node.def b/templates/show/vpn/ipsec/status/node.def
index ac82328..4611fdd 100644
--- a/templates/show/vpn/ipsec/status/node.def
+++ b/templates/show/vpn/ipsec/status/node.def
@@ -1,2 +1,7 @@
 help: Show status of IPsec process
-run: sudo /opt/vyatta/bin/sudo-users/command_proc_show_vpn show_vpn_ipsec_status.xsl
+run:	sudo /opt/vyatta/bin/sudo-users/command_proc_show_vpn show_vpn_ipsec_status.xsl
+			if pgrep pluto >&/dev/null; then
+				active_tunnels=`ipsec status 2> /dev/null | grep -i "ipsec sa established" | wc -l | sed s/\ //g`
+				echo "$active_tunnels Active IPsec Tunnels"
+				echo
+			fi
-- 
cgit v1.2.3

