diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2018-10-22 11:09:47 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2018-10-22 11:09:47 +0100 |
commit | 64e107b9b6058580ff0432107eb37cefb0b2a7d8 (patch) | |
tree | 9a44e603e2ae365e2b1fe35ac37f73e830cdee1d /net-proxy/trojan/files | |
parent | 957235cf19a691360c720f7913672adda4258ed0 (diff) |
gentoo resync : 22.10.2018
Diffstat (limited to 'net-proxy/trojan/files')
-rwxr-xr-x | net-proxy/trojan/files/trojan.initd | 26 |
1 files changed, 26 insertions, 0 deletions
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 $? +} |