diff options
Diffstat (limited to 'net-proxy/trojan/files/trojan.initd')
-rw-r--r-- | net-proxy/trojan/files/trojan.initd | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/net-proxy/trojan/files/trojan.initd b/net-proxy/trojan/files/trojan.initd index cee794ad4d72..2990245430db 100644 --- a/net-proxy/trojan/files/trojan.initd +++ b/net-proxy/trojan/files/trojan.initd @@ -1,10 +1,17 @@ #!/sbin/openrc-run -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # 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" +TJ_NAME=${SVCNAME##*.} +if [ -n "${TJ_NAME}" -a "${SVCNAME}" != "trojan" ]; then + TJ_PIDFILE="/run/trojan.${TJ_NAME}.pid" + TJ_CONFIG="/etc/trojan/${TJ_NAME}.json" + TJ_LOG="/var/log/trojan.${TJ_NAME}.log" +else + TJ_PIDFILE="/run/trojan.pid" + TJ_CONFIG="/etc/trojan/config.json" + TJ_LOG="/var/log/trojan.log" +fi depend() { need net |