mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-07-25 00:13:09 +00:00
~适配1.14+版本singbox内核
This commit is contained in:
@@ -55,6 +55,14 @@ extract_base_jsons() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
generate_basic_jsons() {
|
generate_basic_jsons() {
|
||||||
|
#适配1.14+版本
|
||||||
|
if [ "$(printf '%s' "$core_v" | cut -d. -f2)" -lt 14 ];then
|
||||||
|
preferred='"ip_accept_any": true,'
|
||||||
|
detour_direct='"download_detour": "DIRECT"'
|
||||||
|
else
|
||||||
|
preferred='"preferred_by": [ "hosts" ],'
|
||||||
|
detour_direct='"http_client": "detour_direct"'
|
||||||
|
fi
|
||||||
#生成endpoints.json
|
#生成endpoints.json
|
||||||
[ "$ts_service" = ON ] || [ "$wg_service" = ON ] && [ "$zip_type" != upx ] && {
|
[ "$ts_service" = ON ] || [ "$wg_service" = ON ] && [ "$zip_type" != upx ] && {
|
||||||
. "$CRASHDIR"/configs/gateway.cfg
|
. "$CRASHDIR"/configs/gateway.cfg
|
||||||
@@ -92,7 +100,7 @@ EOF
|
|||||||
],
|
],
|
||||||
"rules": [
|
"rules": [
|
||||||
{
|
{
|
||||||
"preferred_by": [ "hosts" ],
|
$preferred
|
||||||
"server": "hosts"
|
"server": "hosts"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -158,7 +166,7 @@ generate_dns_related_jsons() {
|
|||||||
"format": "binary",
|
"format": "binary",
|
||||||
$srs_path
|
$srs_path
|
||||||
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cn.srs",
|
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cn.srs",
|
||||||
"http_client": "detour_direct"
|
$detour_direct
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user