]> git.ipfire.org Git - people/ms/network.git/commitdiff
ipsec: Allow defining START_ACTION
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 3 Aug 2017 15:40:21 +0000 (15:40 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 3 Aug 2017 15:40:21 +0000 (15:40 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.ipsec

index cefab1171dfe3ff5931ef783b7bf7addff9d8459..db9e5f0d6b7041ecf94089e924062062db1168ae 100644 (file)
@@ -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 "}"