mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-05-14 00:51:12 +03:00
Update sing-box core
This commit is contained in:
@@ -5,7 +5,9 @@
|
||||
"dns": {
|
||||
"servers": [
|
||||
{
|
||||
"address": "tls://8.8.8.8"
|
||||
"type": "tls",
|
||||
"tag": "google",
|
||||
"server": "8.8.8.8"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -26,17 +28,13 @@
|
||||
"outbounds": [
|
||||
{
|
||||
"type": "direct"
|
||||
},
|
||||
{
|
||||
"type": "dns",
|
||||
"tag": "dns-out"
|
||||
}
|
||||
],
|
||||
"route": {
|
||||
"rules": [
|
||||
{
|
||||
"port": 53,
|
||||
"outbound": "dns-out"
|
||||
"action": "hijack-dns"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
6
release/config/sing-box.confd
Normal file
6
release/config/sing-box.confd
Normal file
@@ -0,0 +1,6 @@
|
||||
# /etc/conf.d/sing-box: config file for /etc/init.d/sing-box
|
||||
|
||||
# sing-box configuration path, could be file or directory
|
||||
# SINGBOX_CONFIG=/etc/sing-box
|
||||
|
||||
# SINGBOX_WORKDIR=/var/lib/sing-box
|
||||
32
release/config/sing-box.initd
Normal file → Executable file
32
release/config/sing-box.initd
Normal file → Executable file
@@ -4,15 +4,41 @@ name=$RC_SVCNAME
|
||||
description="sing-box service"
|
||||
supervisor="supervise-daemon"
|
||||
command="/usr/bin/sing-box"
|
||||
command_args="-D /var/lib/sing-box -C /etc/sing-box run"
|
||||
extra_commands="checkconfig"
|
||||
extra_started_commands="reload"
|
||||
|
||||
: ${SINGBOX_CONFIG:=${config:-"/etc/sing-box"}}
|
||||
|
||||
if [ -d "$SINGBOX_CONFIG" ]; then
|
||||
_config_opt="-C $SINGBOX_CONFIG"
|
||||
elif [ -z "$SINGBOX_CONFIG" ]; then
|
||||
_config_opt=""
|
||||
else
|
||||
_config_opt="-c $SINGBOX_CONFIG"
|
||||
fi
|
||||
|
||||
_workdir=${SINGBOX_WORKDIR:-${workdir:-"/var/lib/sing-box"}}
|
||||
|
||||
command_args="run --disable-color
|
||||
-D $_workdir
|
||||
$_config_opt"
|
||||
|
||||
depend() {
|
||||
after net dns
|
||||
}
|
||||
|
||||
checkconfig() {
|
||||
ebegin "Checking $RC_SVCNAME configuration"
|
||||
sing-box check -D "$_workdir" $_config_opt
|
||||
eend $?
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkconfig
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "Reloading $RC_SVCNAME"
|
||||
$supervisor "$RC_SVCNAME" --signal HUP
|
||||
checkconfig && $supervisor "$RC_SVCNAME" --signal HUP
|
||||
eend $?
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user