From: Jonatan Schlag Date: Thu, 8 Mar 2018 09:09:02 +0000 (+0000) Subject: IPsec: regenerate a swanctl config on connection startup if no config is found X-Git-Tag: 010~144 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e354370ac20c7e80881173b83850a7f37daaf73a;p=network.git IPsec: regenerate a swanctl config on connection startup if no config is found 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 Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.ipsec b/src/functions/functions.ipsec index 6f14c8ea..d8206e01 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}" }