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