]> git.ipfire.org Git - people/ms/network.git/blobdiff - src/functions/functions.ipsec
ipsec: reload connection when the security policy changes
[people/ms/network.git] / src / functions / functions.ipsec
index 5a464b5deb6a098dccc420d2e5602c20ea30bf5b..015b3b81d48fc9a8fc036dcc7118e42f3ed0b50b 100644 (file)
@@ -293,6 +293,13 @@ ipsec_connection_exists() {
        [ -d "${path}" ] && return ${EXIT_TRUE} || return ${EXIT_FALSE}
 }
 
+ipsec_strongswan_load() {
+       if ! cmd swanctl --load-all; then
+               log ERROR "Could not reload strongswan config"
+               return ${EXIT_ERROR}
+       fi
+}
+
 # Reloads the connection after config changes
 ipsec_reload() {
        local connection=${1}
@@ -302,10 +309,7 @@ ipsec_reload() {
                return ${EXIT_ERROR}
        fi
 
-       if ! cmd swanctl --load-all; then
-               log ERROR "Could not reload strongswan config"
-               return ${EXIT_ERROR}
-       fi
+       ipsec_strongswan_load
 }
 
 # Handle the cli after authentification