| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# PROVIDE: kcptun |
| 4 |
# REQUIRE: NETWORKING |
| 5 |
# KEYWORD: shutdown |
| 6 |
|
| 7 |
# FreeBSD startup script, rename and put this file to |
| 8 |
# /usr/local/etc/rc.d/kcptun |
| 9 |
# and, run: |
| 10 |
# chmod +x /usr/local/etc/rc.d/kcptun |
| 11 |
# echo kcptun_enable="YES" >> /etc/rc.conf |
| 12 |
# service kcptun start |
| 13 |
|
| 14 |
. /etc/rc.subr |
| 15 |
|
| 16 |
name="kcptun" # How the service will be invoked from service |
| 17 |
desc="kcptun daemon" # the description |
| 18 |
rcvar="kcptun_enable" # The variable in rc.conf that will allow this service to run |
| 19 |
load_rc_config $name # Loads the config file, if relevant. |
| 20 |
: ${kcptun_enable:="NO"} |
| 21 |
|
| 22 |
dir="/home/xtaci" # change this to the directory where kcptun binaries are. |
| 23 |
command="/usr/sbin/daemon" |
| 24 |
pidfile="/var/run/${name}.pid" |
| 25 |
command_args="-u nobody -c -f -S -P ${pidfile} -r $dir/client_freebsd_amd64 -c $dir/local-ss.json" |
| 26 |
|
| 27 |
run_rc_command "$1" |