]> git.ipfire.org Git - people/ms/network.git/commitdiff
ipsec-pool: delete on destroy also the swanctl configuration file
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Wed, 16 Aug 2017 15:36:55 +0000 (17:36 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Aug 2017 11:31:38 +0000 (13:31 +0200)
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.ipsec-pool

index 5decaa40714599f486ba71b0a1a645f4e59e6abc..54bf29e19199128ac8646f646198bee5a806289e 100644 (file)
@@ -229,6 +229,13 @@ ipsec_pool_destroy() {
                        continue
                fi
 
+               if [ -f "${NETWORK_IPSEC_SWANCTL_POOLS_DIR}/${pool}.conf" ]; then
+                       if ! file_delete "${NETWORK_IPSEC_SWANCTL_POOLS_DIR}/${pool}.conf"; then
+                               # We going on here to delete at least the configuration directory
+                               log ERROR "Could not delete ${NETWORK_IPSEC_SWANCTL_POOLS_DIR}/${pool}.conf"
+                       fi
+               fi
+
                log DEBUG "Deleting VPN IPsec pool ${pool}"
 
                if ! rm -rf "${NETWORK_IPSEC_POOLS_DIR}/${pool}"; then