From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: network@lists.ipfire.org Subject: Re: [PATCH 1/2] network reset: destroy all IPsec pools Date: Thu, 24 Aug 2017 13:57:02 +0100 Message-ID: <1503579422.14476.6.camel@ipfire.org> In-Reply-To: <1503579031-6442-1-git-send-email-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2783430502042586116==" List-Id: --===============2783430502042586116== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hi, On Thu, 2017-08-24 at 14:50 +0200, Jonatan Schlag wrote: > Fixes: #11432 > > Signed-off-by: Jonatan Schlag > --- > src/functions/functions.ipsec-pool | 9 +++++++++ > src/network | 5 +++++ > 2 files changed, 14 insertions(+) > > diff --git a/src/functions/functions.ipsec-pool > b/src/functions/functions.ipsec-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 > +} Please use list_directory for this. And you are again missing the quotes in [ -d ... ]. > 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 > > + local pool > + for pool in $(ipsec_list_pools); do > + ipsec_pool_destroy "${pool}" > + done > + > # Stop strongswan > ipsec_strongswan_autostart > -Michael --===============2783430502042586116== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUFCQ2dBZEZpRUU1L3JXNWwzR0dl Mnlwa3R4Z0hudy8yK1FDUWNGQWxtZXpS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