1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-20 01:35:13 +03:00
aports/testing/v2ray/v2ray.initd
nibon7 d1bb348ccf testing/v2ray: new aport
Signed-off-by: nibon7 <nibon7@163.com>
2021-03-06 16:22:19 +00:00

36 lines
663 B
Text

#!/sbin/openrc-run
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
V2_CONFIG="/etc/v2ray/config.json"
V2_PIDFILE="/run/v2ray.pid"
V2_LOG="/var/log/v2ray.log"
depend() {
need net
}
checkconfig() {
if [ ! -f ${V2_CONFIG} ]; then
ewarn "${V2_CONFIG} does not exist."
fi
}
start() {
checkconfig || return 1
ebegin "Starting V2ray"
ebegin "Log File : ${V2_LOG}"
start-stop-daemon --start \
-b -1 ${V2_LOG} -2 ${V2_LOG} \
-m -p ${V2_PIDFILE} \
--exec /usr/bin/v2ray -- -config ${V2_CONFIG}
eend $?
}
stop() {
ebegin "Stopping V2ray"
start-stop-daemon --stop -p ${V2_PIDFILE}
eend $?
}