blob: 8a21f910cfa6d3c48da5ce88e362b901536d56ac (
plain)
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
|
#!/bin/sh
# $FreeBSD$
# PROVIDE: shadowsocks-libev
# REQUIRE: LOGIN cleanvar
# KEYWORD: shutdown
# Add the following lines to /etc/rc.conf to enable shadowsocks-libev:
# shadowsocks_libev_enable (bool): Set to "NO" by default.
# Set to "YES" to enable shadowsocks-libev.
# shadowsocks_libev_config (path): Shadowsocks config file.
# Defaults to "%%PREFIX%%/etc/shadowsocks-libev/config.json"
. /etc/rc.subr
name="shadowsocks_libev"
rcvar=shadowsocks_libev_enable
load_rc_config $name
: ${shadowsocks_libev_enable:="NO"}
: ${shadowsocks_libev_config="%%PREFIX%%/etc/shadowsocks-libev/config.json"}
command="%%PREFIX%%/bin/ss-server"
pidfile="/var/run/shadowsocks-libev.pid"
required_files="${shadowsocks_libev_config}"
command_args="-f $pidfile -c $shadowsocks_libev_config"
run_rc_command "$1"
|