]> git.ipfire.org Git - network.git/commitdiff
network reset: destroy all IPsec pools
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Wed, 16 Aug 2017 15:18:46 +0000 (17:18 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Aug 2017 11:30:47 +0000 (13:30 +0200)
Fixes: #11432
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.ipsec-pool
src/network

index 4eb0e4e721d2afc8bd39deafcc04e1abfdd20549..5decaa40714599f486ba71b0a1a645f4e59e6abc 100644 (file)
@@ -420,3 +420,12 @@ ipsec_pool_to_strongswan() {
                fi
        ) > ${path}
 }
+
+# List all IPsec pools
+ipsec_list_pools() {
+       local pool
+       for pool in ${NETWORK_IPSEC_POOLS_DIR}/*; do
+               [ -d "${pool}" ] || continue
+               basename "${pool}"
+       done
+}
index bc4210c0506b8afc72d8aa63a61314562e2062f1..71b0cdec734ed2e51d733ec2a851be6ea39486fa 100644 (file)
@@ -1154,6 +1154,11 @@ cli_reset() {
                ipsec_connection_destroy "${connection}"
        done
 
+       local pool
+       for pool in $(ipsec_list_pools); do
+               ipsec_pool_destroy "${pool}"
+       done
+
        # Stop strongswan
        ipsec_strongswan_autostart