From 8016f252e14c9af93fd17753eeb20d035ccfcb7e Mon Sep 17 00:00:00 2001 From: mh Date: Sat, 10 Aug 2013 20:53:48 +0200 Subject: add info script --- templates/scripts/info.sh.erb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 templates/scripts/info.sh.erb (limited to 'templates') diff --git a/templates/scripts/info.sh.erb b/templates/scripts/info.sh.erb new file mode 100644 index 0000000..d48a97e --- /dev/null +++ b/templates/scripts/info.sh.erb @@ -0,0 +1,8 @@ +#!/bin/bash +connected=`<%= scope.lookupvar('strongswan::base::binary_name') %>_connected_hosts` +grep -El '^conn' /etc/ipsec.d/hosts/* | while read line; do + host=`basename $line '.conf'` + echo $connected | grep -q $host + ([ $? -eq 0 ] && echo "+ ${host}") || echo " ${host}" +done + -- cgit v1.2.3