From 37317b3eb7b138ace1ba59c9e72bc46ec3beef75 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 3 Aug 2017 15:40:21 +0000 Subject: [PATCH] ipsec: Allow defining START_ACTION Signed-off-by: Michael Tremer --- src/functions/functions.ipsec | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/functions/functions.ipsec b/src/functions/functions.ipsec index cefab117..db9e5f0d 100644 --- a/src/functions/functions.ipsec +++ b/src/functions/functions.ipsec @@ -918,9 +918,23 @@ _ipsec_connection_to_strongswan_connection() { print fi - # XXX Always-On - print_indent 4 "start_action = start" - print_indent 4 "close_action = start" + # Start Action + print_indent 4 "# Start Action" + case "${START_ACTION}" in + on-demand) + print_indent 4 "start_action = trap" + print_indent 4 "close_action = trap" + ;; + wait) + print_indent 4 "start_action = none" + print_indent 4 "close_action = none" + ;; + always-on|*) + print_indent 4 "start_action = start" + print_indent 4 "close_action = start" + ;; + esac + print print_indent 3 "}" print_indent 2 "}" -- 2.39.2