#!/bin/sh # PROVIDE: kcptun # REQUIRE: NETWORKING # KEYWORD: shutdown # FreeBSD startup script, rename and put this file to # /usr/local/etc/rc.d/kcptun # and, run: # chmod +x /usr/local/etc/rc.d/kcptun # echo kcptun_enable="YES" >> /etc/rc.conf # service kcptun start . /etc/rc.subr name="kcptun" # How the service will be invoked from service desc="kcptun daemon" # the description rcvar="kcptun_enable" # The variable in rc.conf that will allow this service to run load_rc_config $name # Loads the config file, if relevant. : ${kcptun_enable:="NO"} dir="/root" # change this to the directory where kcptun binaries are. command="/usr/sbin/daemon" pidfile="/var/run/${name}.pid" command_args="-c -f -S -P ${pidfile} -r $dir/server_freebsd_amd64 -c $dir/server_ss.json" run_rc_command "$1"