]> git.ipfire.org Git - people/stevee/network.git/commitdiff
ipsec: add new function ipsec_list_connections
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Thu, 3 Aug 2017 10:51:22 +0000 (12:51 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 3 Aug 2017 11:23:18 +0000 (13:23 +0200)
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/functions/functions.ipsec

index ed889a648756eed98523b585beb1e738a7b131be..a174a7ff16acb160ea34801f0c882d991328b8ad 100644 (file)
@@ -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
+}