summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-08-10 18:29:01 +0200
committerMicah Anderson <micah@riseup.net>2013-08-10 19:54:43 +0200
commiteda32d86ad0d486d86a7eee92e5accbab10104dc (patch)
tree3aa24f1d46db3e238ecf2d5ee562afe4da917585
parentf22c3da35a1ef2230c78474e7f21b9fec9d37c03 (diff)
clear line
-rw-r--r--templates/remote_host.erb22
1 files changed, 12 insertions, 10 deletions
diff --git a/templates/remote_host.erb b/templates/remote_host.erb
index 52639cd..4f35478 100644
--- a/templates/remote_host.erb
+++ b/templates/remote_host.erb
@@ -1,21 +1,23 @@
# host <%= name %>
<% if !(right_id =~ /#{scope.lookupvar('::fqdn')}/) -%>
-conn <%= name %>
-<% if left_ip_address != 'absent' -%>
- left=<%= left_ip_address %>
+<% Array(right_ip_address).each_with_index do |right_ip,i| -%>
+conn <%= name %><% if i > 0 -%>-<%= i %><% end -%>
<% end -%>
-<% if left_id != 'absent' -%>
+<% if left_ip_address != 'absent' -%>
+ left=<%= left_ip_address %>
+<% end -%>
+<% if left_id != 'absent' -%>
leftid=@<%= left_id %>
-<% end -%>
-<% unless left_subnet.empty? %>
+<% end -%>
+<% unless left_subnet.empty? -%>
leftsubnet=<%= left_subnet.collect{|s| s.include?('/') ? s : (s.include?(':') ? "#{s}/128" : "#{s}/32" ) }.join(',') %>
-<% end -%>
- right=<%= right_ip_address %>
+<% end -%>
+ right=<%= right_ip %>
rightid=@<%= right_id %>
rightcert=<%= right_cert_name %>.asc
-<% unless right_subnet.empty? -%>
+<% unless right_subnet.empty? -%>
rightsubnet=<%= right_subnet.collect{|s| s.include?('/') ? s : (s.include?(':') ? "#{s}/128" : "#{s}/32" ) }.join(',') %>
-<% end -%>
+<% end -%>
type=transport
auto=start
<% else -%>