From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: network@lists.ipfire.org Subject: Re: [PATCH] network reset: destroy all IPsec pools Date: Thu, 17 Aug 2017 11:59:24 +0100 Message-ID: <1502967564.2431.0.camel@ipfire.org> In-Reply-To: <1502896726-13445-1-git-send-email-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1773814587096575190==" List-Id: --===============1773814587096575190== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi, On Wed, 2017-08-16 at 17:18 +0200, Jonatan Schlag wrote: > Fixes: #11432 >=20 > Signed-off-by: Jonatan Schlag > --- > src/functions/functions.ipsec-pool | 9 +++++++++ > src/network | 5 +++++ > 2 files changed, 14 insertions(+) >=20 > diff --git a/src/functions/functions.ipsec-pool b/src/functions/functions.i= psec-pool > index 4eb0e4e..fb7e7da 100644 > --- a/src/functions/functions.ipsec-pool > +++ b/src/functions/functions.ipsec-pool > @@ -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 > +} This needs quotes in the []. I will add this when I merge the patch. > diff --git a/src/network b/src/network > index bc4210c..71b0cde 100644 > --- a/src/network > +++ b/src/network > @@ -1154,6 +1154,11 @@ cli_reset() { > ipsec_connection_destroy "${connection}" > done > =20 > + local pool > + for pool in $(ipsec_list_pools); do > + ipsec_pool_destroy "${pool}" > + done > + > # Stop strongswan > ipsec_strongswan_autostart > =20 --===============1773814587096575190== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUFCQ2dBZEZpRUU1L3JXNWwzR0dl Mnlwa3R4Z0hudy8yK1FDUWNGQWxtVmR3d0F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