Skip to content

Commit

Permalink
add a bsd rc dist
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Jul 16, 2024
1 parent 96ef4c9 commit bfa9c1d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions dist/kcptun.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh
# 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 start kcptun

. /etc/rc.subr

name="kcptun" # How the service will be invoked from service
rcvar="${name}_enable" # The variable in rc.conf that will allow this service to run
load_rc_config $name # Loads the config file, if relevant.

dir="/home/xtaci" # change this to the directory where kcptun binaries are.
pidfile="$dir/kcptun.pid"
start_cmd="daemon -p $pidfile $dir/client_freebsd_amd64 -c $dir/local-ss.json"
stop_cmd="kill $(cat $pidfile); echo kcptun is not running."

run_rc_command "$1"

0 comments on commit bfa9c1d

Please sign in to comment.