aboutsummaryrefslogtreecommitdiff
path: root/net/shadowsocks-rust/files/ssserver-rust.in
blob: 24bee1855a2e986656f76137eb768e6e85fceeb2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh

# PROVIDE: ssserver_rust
# REQUIRE: NETWORKING SERVERS
#
# Add the following lines to /etc/rc.conf to run ssserver:
# ssserver_rust_enable (bool):	Set it to "YES" to enable ssserver.
#				Default is "NO".
# ssserver_rust_args (string):	Set it to the desired arguments to run ssserver.
#				Default is "-c %%ETCDIR%%/config.json".
#

. /etc/rc.subr

name="ssserver_rust"
rcvar=ssserver_rust_enable

pidfile="/var/run/${name}.pid"
logfile="/var/log/${name}.log"

: ${ssserver_rust_enable="NO"}
: ${ssserver_rust_args="-c %%ETCDIR%%/config.json"}

procname=%%PREFIX%%/bin/ssserver
command="/usr/sbin/daemon"
command_args="-f -S \
	-p ${pidfile} \
	-o ${logfile} \
	-t ${name}_ssserver \
	%%PREFIX%%/bin/ssserver $ssserver_rust_args"

load_rc_config $name
run_rc_command "$1"