From 64e107b9b6058580ff0432107eb37cefb0b2a7d8 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 22 Oct 2018 11:09:47 +0100 Subject: gentoo resync : 22.10.2018 --- net-proxy/trojan/files/trojan.initd | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 net-proxy/trojan/files/trojan.initd (limited to 'net-proxy/trojan/files') diff --git a/net-proxy/trojan/files/trojan.initd b/net-proxy/trojan/files/trojan.initd new file mode 100755 index 000000000000..f525eefe74df --- /dev/null +++ b/net-proxy/trojan/files/trojan.initd @@ -0,0 +1,26 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +TJ_CONFIG="/etc/trojan/config.json" +TJ_PIDFILE="/run/trojan.pid" +TJ_LOG="/var/log/trojan.log" + +depend() { + need net +} + +start() { + ebegin "Starting Trojan, Log File: ${TJ_LOG}" + start-stop-daemon --start -b \ + -1 "${TJ_LOG}" -2 "${TJ_LOG}" \ + -m -p "${TJ_PIDFILE}" \ + --exec /usr/bin/trojan -- "${TJ_CONFIG}" + eend $? +} + +stop() { + ebegin "Stopping Trojan" + start-stop-daemon --stop -p "${TJ_PIDFILE}" + eend $? +} -- cgit v1.2.3