Update xray

pull/86/head
winds365 2025-03-09 09:20:05 +08:00 committed by yuhan6665
parent 25dc8d6542
commit 167d978e96
1 changed files with 11 additions and 9 deletions

View File

@ -1,23 +1,22 @@
#!/sbin/openrc-run #!/sbin/openrc-run
supervisor=supervise-daemon
name="Xray" name="Xray"
description="The best v2ray-core, with XTLS support" description="The best v2ray-core, with XTLS support"
description_checkconfig="Test configuration file" description_checkconfig="Test configuration file"
: ${env:="XRAY_LOCATION_ASSET=/usr/local/lib/xray/"} : ${env:="XRAY_LOCATION_ASSET=/usr/local/share/xray/"}
: ${confdir:="/usr/local/etc/xray/"} : ${confdir:="/usr/local/etc/xray/"}
command="/usr/local/bin/xray" command="/usr/local/bin/xray"
command_args="run -confdir $confdir" command_args="run -confdir $confdir"
command_user="nobody" command_user="nobody"
pidfile="/run/xray.pid"
command_background="yes"
extra_commands="checkconfig" extra_commands="checkconfig"
capabilities="^cap_net_bind_service"
depend() { depend() {
need net need net localmount
after firewall
} }
checkconfig() { checkconfig() {
@ -26,9 +25,12 @@ checkconfig() {
return 1 return 1
fi fi
export $env export $env
$command $command_args -test su ${command_user%:*} -s /bin/sh -c "$command $command_args -test"
eend $?
} }
start_pre() { stop_pre() {
checkconfig if [ "$RC_CMD" = restart ]; then
checkconfig || return $?
fi
} }