diff options
author | Pacien TRAN-GIRARD | 2017-06-30 10:21:51 +0200 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2017-06-30 10:21:51 +0200 |
commit | c89016e7427defd1f8a095d7aeb30292a42fad92 (patch) | |
tree | aec80e6f501824f966ea727d2f6e102a75e9655f /app/src/main/java/org/pacien/tincapp/commands/Tincd.kt | |
parent | 94d77ce43152a4e144417d8d5cfff363f65c904e (diff) | |
download | tincapp-c89016e7427defd1f8a095d7aeb30292a42fad92.tar.gz |
Conversion to Kotlin
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 | } | ||