aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/pacien/tincapp/commands
diff options
context:
space:
mode:
authorpacien2018-02-16 18:23:01 +0100
committerpacien2018-02-16 18:23:01 +0100
commitc359d78bcd45cb506bac51a616ef62af0845df85 (patch)
treee526bbf710d301310fdee6a0da6399fb79c71f66 /app/src/main/java/org/pacien/tincapp/commands
parent680fe07b6ea000ee29ac28e2f48665433e7011df (diff)
downloadtincapp-c359d78bcd45cb506bac51a616ef62af0845df85.tar.gz
Refactor activities and service, locking app at daemon startup and shutdown
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/commands')
-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")