Lines 8-22
Link Here
|
8 |
# Add the following lines to /etc/rc.conf to enable shadowsocks-libev: |
8 |
# Add the following lines to /etc/rc.conf to enable shadowsocks-libev: |
9 |
# shadowsocks_libev_enable (bool): Set to "NO" by default. |
9 |
# shadowsocks_libev_enable (bool): Set to "NO" by default. |
10 |
# Set to "YES" to enable shadowsocks-libev. |
10 |
# Set to "YES" to enable shadowsocks-libev. |
11 |
# shadowsocks_libev_host (ip addr/hostname): Set to "0.0.0.0" by default. |
11 |
# shadowsocks_libev_config (path): Shadowsocks config file. |
12 |
# shadowsocks_libev_port (port number): Set to 8388 by default. |
12 |
# Defaults to "%%PREFIX%%/etc/shadowsocks-libev/config.json" |
13 |
# shadowsocks_libev_localport (local port): Set to 1080 by default. |
|
|
14 |
# shadowsocks_libev_password (password): Set to ""(null) by default. |
15 |
# shadowsocks_libev_encrypt_method (encrypt method): Set to rc4 by default. |
16 |
# Available methods: table, rc4, aes-128-cfb, aes-192-cfb, aes-256-cfb, |
17 |
# bf-cfb, camellia-128-cfb, camellia-192-cfb, camellia-256-cfb, |
18 |
# cast5-cfb, des-cfb, idea-cfb, rc2-cfb and seed-cfb |
19 |
# shadowsocks_libev_timeout (time): Set to "300" seconds by default. |
20 |
|
13 |
|
21 |
|
14 |
|
22 |
. /etc/rc.subr |
15 |
. /etc/rc.subr |
Lines 28-50
Link Here
|
28 |
load_rc_config $name |
21 |
load_rc_config $name |
29 |
|
22 |
|
30 |
: ${shadowsocks_libev_enable:="NO"} |
23 |
: ${shadowsocks_libev_enable:="NO"} |
31 |
: ${shadowsocks_libev_host="0.0.0.0"} |
24 |
: ${shadowsocks_libev_config="%%PREFIX%%/etc/shadowsocks-libev/config.json"} |
32 |
: ${shadowsocks_libev_port=8388} |
|
|
33 |
: ${shadowsocks_libev_localport=1080} |
34 |
: ${shadowsocks_libev_password=""} |
35 |
: ${shadowsocks_libev_encrypt_method="rc4"} |
36 |
: ${shadowsocks_libev_timeout="300"} |
37 |
|
25 |
|
38 |
command="%%PREFIX%%/bin/ss-server" |
26 |
command="%%PREFIX%%/bin/ss-server" |
39 |
pidfile="/var/run/shadowsocks-libev.pid" |
27 |
pidfile="/var/run/shadowsocks-libev.pid" |
|
|
28 |
required_files="${shadowsocks_libev_config}" |
40 |
|
29 |
|
41 |
: ${shadowsocks_libev_flags:="-s ${shadowsocks_libev_host} \ |
30 |
command_args="-f $pidfile -c $shadowsocks_libev_config" |
42 |
-p ${shadowsocks_libev_port} \ |
|
|
43 |
-l ${shadowsocks_libev_localport} \ |
44 |
-k ${shadowsocks_libev_password} \ |
45 |
-m ${shadowsocks_libev_encrypt_method} \ |
46 |
-f ${pidfile} \ |
47 |
-t ${shadowsocks_libev_timeout}"} |
48 |
|
49 |
|
31 |
|
50 |
run_rc_command "$1" |
32 |
run_rc_command "$1" |