From: Jonatan Schlag Date: Fri, 4 Aug 2017 19:26:36 +0000 (+0200) Subject: ipsec: reload connection when the config changes X-Git-Tag: 009~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=39d87f20b42f7c54ce65506eea59b3534b191b17;p=network.git ipsec: reload connection when the config changes Signed-off-by: Jonatan Schlag Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.ipsec b/src/functions/functions.ipsec index 61bdcb28..5a464b5d 100644 --- a/src/functions/functions.ipsec +++ b/src/functions/functions.ipsec @@ -295,7 +295,17 @@ ipsec_connection_exists() { # Reloads the connection after config changes ipsec_reload() { - return ${EXIT_TRUE} + local connection=${1} + + if ! ipsec_connection_to_strongswan ${connection}; then + log ERROR "Could not generate strongswan config for ${connnection}" + return ${EXIT_ERROR} + fi + + if ! cmd swanctl --load-all; then + log ERROR "Could not reload strongswan config" + return ${EXIT_ERROR} + fi } # Handle the cli after authentification