From d6c852b8157f42e2fdac9f5c01d553607b943887 Mon Sep 17 00:00:00 2001 From: Jonatan Schlag Date: Thu, 3 Aug 2017 12:51:22 +0200 Subject: [PATCH] ipsec: add new function ipsec_list_connections Signed-off-by: Jonatan Schlag Signed-off-by: Michael Tremer --- src/functions/functions.ipsec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/functions/functions.ipsec b/src/functions/functions.ipsec index ed889a64..a174a7ff 100644 --- a/src/functions/functions.ipsec +++ b/src/functions/functions.ipsec @@ -729,3 +729,12 @@ ipsec_connection_destroy() { fi done } + +# List all ipsec connections +ipsec_list_connections() { + local connection + for connection in ${NETWORK_IPSEC_CONNS_DIR}/*; do + [ -d ${connection} ] || continue + basename ${connection} + done +} -- 2.47.3