diff options
author | mh <mh@immerda.ch> | 2013-01-20 13:03:43 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2013-01-20 13:03:43 +0100 |
commit | 00cd79935ca5420daa37cadccba878cd7efd75b5 (patch) | |
tree | bfb619b91fd946941036cc5b16ef1404928c34db /templates | |
parent | d4e8331218db1f35caf69484f8e71adb6f852fab (diff) |
add a script to try to connect to all not yet connected hosts
Diffstat (limited to 'templates')
-rw-r--r-- | templates/scripts/start_unconnected.sh.erb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/templates/scripts/start_unconnected.sh.erb b/templates/scripts/start_unconnected.sh.erb new file mode 100644 index 0000000..0dbaffe --- /dev/null +++ b/templates/scripts/start_unconnected.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 + [ $? -gt 0 ] && <%= scope.lookupvar('strongswan::base::binary_name') %> up $host +done + |