From c359d78bcd45cb506bac51a616ef62af0845df85 Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 16 Feb 2018 18:23:01 +0100 Subject: Refactor activities and service, locking app at daemon startup and shutdown --- app/src/main/java/org/pacien/tincapp/commands/Tinc.kt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/src/main/java/org/pacien/tincapp/commands/Tinc.kt') diff --git a/app/src/main/java/org/pacien/tincapp/commands/Tinc.kt b/app/src/main/java/org/pacien/tincapp/commands/Tinc.kt index 0b1240a..e0cdb12 100644 --- a/app/src/main/java/org/pacien/tincapp/commands/Tinc.kt +++ b/app/src/main/java/org/pacien/tincapp/commands/Tinc.kt @@ -17,6 +17,10 @@ object Tinc { Executor.call(newCommand(netName).withArguments("stop")) .thenApply { } + fun pid(netName: String): CompletableFuture = + Executor.call(newCommand(netName).withArguments("pid")) + .thenApply { Integer.parseInt(it.first()) } + fun dumpNodes(netName: String, reachable: Boolean = false): CompletableFuture> = Executor.call( if (reachable) newCommand(netName).withArguments("dump", "reachable", "nodes") -- cgit v1.2.3