aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/pacien/tincapp/commands/Tincd.java
blob: 07acc3d154a3624f956d3071236eb0692f39c160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package org.pacien.tincapp.commands;

import android.content.Context;

import org.pacien.tincapp.context.AppPaths;

import java.io.IOException;

/**
 * @author pacien
 */
final public class Tincd {

	private Tincd() {
		// static class
	}

	static public void start(Context ctx, String netName, Integer fd) throws IOException {
		Executor.forkExec(new Command(AppPaths.tincd(ctx).getAbsolutePath())
				.withOption("no-detach")
				.withOption("config", AppPaths.confDir(ctx, netName).getAbsolutePath())
				.withOption("pidfile", AppPaths.pidFile(ctx, netName).getAbsolutePath())
				.withOption("logfile", AppPaths.logFile(ctx, netName).getAbsolutePath())
				.withOption("option", "DeviceType=fd")
				.withOption("option", "Device=" + fd));
	}

}