summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-08-10 20:53:48 +0200
committermh <mh@immerda.ch>2013-08-10 20:53:48 +0200
commit8016f252e14c9af93fd17753eeb20d035ccfcb7e (patch)
tree89387619ec9aef7e0b3697071f584fb607735ca1 /templates
parent0c7c91c6e3ae96c768f343ff1e5436eb0181989b (diff)
add info script
Diffstat (limited to 'templates')
-rw-r--r--templates/scripts/info.sh.erb8
1 files changed, 8 insertions, 0 deletions
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
+