]> git.ipfire.org Git - people/ms/network.git/commitdiff
ipsec-pools: reload pools after destroying pools
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Wed, 16 Aug 2017 15:36:56 +0000 (17:36 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Aug 2017 11:32:56 +0000 (13:32 +0200)
Fixes: #11433
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.ipsec-pool

index 54bf29e19199128ac8646f646198bee5a806289e..95f45ec74c94a695b6068827b8d6997c90d7316b 100644 (file)
@@ -243,6 +243,8 @@ ipsec_pool_destroy() {
                        return ${EXIT_ERROR}
                fi
        done
+
+       ipsec_strongswan_load_pools
 }
 
 ipsec_pool_set_type() {
@@ -436,3 +438,16 @@ ipsec_list_pools() {
                basename "${pool}"
        done
 }
+
+# Reload all strongswan pools
+ipsec_strongswan_load_pools() {
+       # Do nothing if strongswan is not running
+       if ! service_is_active "strongswan"; then
+               return ${EXIT_OK}
+       fi
+
+       if ! cmd swanctl --load-pools; then
+               log ERROR "Could not reload strongswan pools"
+               return ${EXIT_ERROR}
+       fi
+}