From: Jonatan Schlag Date: Wed, 16 Aug 2017 15:36:56 +0000 (+0200) Subject: ipsec-pools: reload pools after destroying pools X-Git-Tag: 010~247 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f5135fb700688248d1de64580dd29544a7f115c1;p=network.git ipsec-pools: reload pools after destroying pools Fixes: #11433 Signed-off-by: Jonatan Schlag Signed-off-by: Michael Tremer --- diff --git a/src/functions/functions.ipsec-pool b/src/functions/functions.ipsec-pool index 54bf29e1..95f45ec7 100644 --- a/src/functions/functions.ipsec-pool +++ b/src/functions/functions.ipsec-pool @@ -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 +}