]> git.ipfire.org Git - people/stevee/network.git/commitdiff
ipsec: reload connection when the config changes
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Fri, 4 Aug 2017 19:26:36 +0000 (21:26 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 4 Aug 2017 20:22:51 +0000 (22:22 +0200)
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.ipsec

index 61bdcb28460ce880e71d298868fb67b3a2ddaee6..5a464b5deb6a098dccc420d2e5602c20ea30bf5b 100644 (file)
@@ -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