Skip to content

Commit

Permalink
fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Jul 16, 2024
1 parent bfa9c1d commit 2078ee7
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions dist/kcptun.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/sh

# PROVIDE: kcptun
# REQUIRE: LOGIN cleanvar
# KEYWORD: shutdown
#
# FreeBSD startup script, rename and put this file to
# /usr/local/etc/rc.d/kcptun
# and, run:
Expand All @@ -9,12 +14,12 @@
. /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
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="/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."
command="$dir/client_freebsd_amd64"
command_args="-c $dir/local-ss.json"

run_rc_command "$1"

0 comments on commit 2078ee7

Please sign in to comment.