2 # Copyright 1999-2020 Gentoo Authors
3 # Distributed under the terms of the GNU General Public License v2
10 if [ "${RC_SVCNAME}" != "xray" ] ; then
11 XR_CFGNAME="${RC_SVCNAME#*.}."
14 XR_CONFIG="/etc/xray/config.${XR_CFGNAME}json"
15 XR_PIDFILE="/run/xray.${XR_CFGNAME}pid"
16 XR_LOG="/var/log/xray.${XR_CFGNAME}log"
18 if [ ! -f ${XR_CONFIG} ]; then
19 ewarn "${XR_CONFIG} does not exist."
27 checkconfig || return 1
29 ebegin "Starting Xray"
30 ebegin "Log File : ${XR_LOG}"
31 start-stop-daemon --start \
32 -b -1 ${XR_LOG} -2 ${XR_LOG} \
34 --exec /usr/bin/xray -- -config ${XR_CONFIG}
40 checkconfig || return 1
41 ebegin "Stopping xray"
42 start-stop-daemon --stop -p ${XR_PIDFILE}