From: Jonatan Schlag Date: Thu, 3 Aug 2017 10:51:22 +0000 (+0200) Subject: ipsec: add new function ipsec_list_connections X-Git-Tag: 009~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6c852b8157f42e2fdac9f5c01d553607b943887;p=network.git ipsec: add new function ipsec_list_connections Signed-off-by: Jonatan Schlag Signed-off-by: Michael Tremer --- 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 +}