frp/conf/openrc/frps.sh

38 lines
718 B
Bash
Raw Normal View History

2019-06-04 22:51:12 +08:00
#!/sbin/openrc-run
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
pidfile="/run/frps.pid"
configfile="/etc/frp/frps.ini"
command="/usr/bin/frps"
command_opts=" -c $configfile"
depend() {
need net
need localmount
}
start() {
ebegin "Starting frps"
start-stop-daemon --start --background \
2019-06-09 23:20:34 +08:00
--make-pidfile --pidfile $pidfile \
2019-06-04 22:51:12 +08:00
--exec $command \
2019-06-09 23:20:34 +08:00
-- $command_opts
2019-06-04 22:51:12 +08:00
eend $?
}
stop() {
ebegin "Stopping frps"
start-stop-daemon --stop \
--exec $command \
--pidfile $pidfile
eend $?
}
reload() {
ebegin "Reloading frps"
start-stop-daemon --exec $command \
--pidfile $pidfile \
-s 1
eend $?
}