diff options
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.kt | 25 |
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 @@ | |||
1 | package org.pacien.tincapp.commands | ||
2 | |||
3 | import android.content.Context | ||
4 | |||
5 | import org.pacien.tincapp.context.AppPaths | ||
6 | |||
7 | import java.io.IOException | ||
8 | |||
9 | /** | ||
10 | * @author pacien | ||
11 | */ | ||
12 | object 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 | } | ||