aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/pacien/tincapp/commands/Tinc.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/commands/Tinc.kt')
-rw-r--r--app/src/main/java/org/pacien/tincapp/commands/Tinc.kt4
1 files changed, 4 insertions, 0 deletions
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 {
17 Executor.call(newCommand(netName).withArguments("stop")) 17 Executor.call(newCommand(netName).withArguments("stop"))
18 .thenApply { } 18 .thenApply { }
19 19
20 fun pid(netName: String): CompletableFuture<Int> =
21 Executor.call(newCommand(netName).withArguments("pid"))
22 .thenApply { Integer.parseInt(it.first()) }
23
20 fun dumpNodes(netName: String, reachable: Boolean = false): CompletableFuture<List<String>> = 24 fun dumpNodes(netName: String, reachable: Boolean = false): CompletableFuture<List<String>> =
21 Executor.call( 25 Executor.call(
22 if (reachable) newCommand(netName).withArguments("dump", "reachable", "nodes") 26 if (reachable) newCommand(netName).withArguments("dump", "reachable", "nodes")