aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/pacien/tincapp/commands/Tincd.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/org/pacien/tincapp/commands/Tincd.kt')
-rw-r--r--app/src/main/java/org/pacien/tincapp/commands/Tincd.kt25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/src/main/java/org/pacien/tincapp/commands/Tincd.kt b/app/src/main/java/org/pacien/tincapp/commands/Tincd.kt
new file mode 100644
index 0000000..9f2491e
--- /dev/null
+++ b/app/src/main/java/org/pacien/tincapp/commands/Tincd.kt
@@ -0,0 +1,25 @@
1package org.pacien.tincapp.commands
2
3import android.content.Context
4
5import org.pacien.tincapp.context.AppPaths
6
7import java.io.IOException
8
9/**
10 * @author pacien
11 */
12object Tincd {
13
14 @Throws(IOException::class)
15 fun start(ctx: Context, netName: String, fd: Int) {
16 Executor.forkExec(Command(AppPaths.tincd(ctx).absolutePath)
17 .withOption("no-detach")
18 .withOption("config", AppPaths.confDir(ctx, netName).absolutePath)
19 .withOption("pidfile", AppPaths.pidFile(ctx, netName).absolutePath)
20 .withOption("logfile", AppPaths.logFile(ctx, netName).absolutePath)
21 .withOption("option", "DeviceType=fd")
22 .withOption("option", "Device=" + fd))
23 }
24
25}