public inbox for network@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH] IPsec: regenerate a swanctl config on connection startup if config is found
@ 2018-03-08  9:08 Jonatan Schlag
  0 siblings, 0 replies; only message in thread
From: Jonatan Schlag @ 2018-03-08  9:08 UTC (permalink / raw)
  To: network

[-- Attachment #1: Type: text/plain, Size: 827 bytes --]

This is an easy way to forcing a regenration if we do not want to change any setting.

Fixes: #11627

Signed-off-by: Jonatan Schlag <jonatan.schlag(a)ipfire.org>
---
 src/functions/functions.ipsec | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/functions/functions.ipsec b/src/functions/functions.ipsec
index 6f14c8e..d8206e0 100644
--- a/src/functions/functions.ipsec
+++ b/src/functions/functions.ipsec
@@ -526,6 +526,12 @@ ipsec_connection_up() {
 		return ${EXIT_ERROR}
 	fi
 
+	if ! [ -f "${NETWORK_IPSEC_SWANCTL_CONNECTIONS_DIR}/${connection}.conf" ]; then
+		log DEBUG "Could not find a swanctl config, generating swanctl config"
+		ipsec_connection_to_strongswan "${connection}"
+		ipsec_strongswan_load
+	fi
+
 	cmd swanctl --initiate --child "${connection}"
 }
 
-- 
2.6.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-08  9:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-08  9:08 [PATCH] IPsec: regenerate a swanctl config on connection startup if config is found Jonatan Schlag

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox