mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-07-24 15:47:11 +00:00
@@ -216,7 +216,7 @@ UPG_CORE_V1_SUFFIX=" \033[32m(原meta内核)支持全面\033[0m \033[33m占
|
||||
UPG_CORE_V1_DOC="说明文档:\033[36;4mhttps://wiki.metacubex.one\033[0m"
|
||||
UPG_CORE_V2_PREFIX="2) \033[43;30mSingBoxR\033[0m:\033[32m"
|
||||
UPG_CORE_V2_SUFFIX=" \033[32m支持全面\033[0m \033[33m使用reF1nd增强分支\033[0m"
|
||||
UPG_CORE_V2_DOC="说明文档:\033[36;4mhttps://sing-boxr.dustinwin.us.kg\033[0m"
|
||||
UPG_CORE_V2_DOC="说明文档:\033[36;4mhttps://sing-boxr.dustinwin.cc.cd\033[0m"
|
||||
UPG_CORE_V3_PREFIX="3) \033[43;30mSingBox\033[0m:\033[32m"
|
||||
UPG_CORE_V3_SUFFIX=" \033[32m占用较低\033[0m \033[33m不支持providers\033[0m"
|
||||
UPG_CORE_V3_DOC="说明文档:\033[36;4mhttps://sing-box.sagernet.org\033[0m"
|
||||
|
||||
@@ -216,7 +216,7 @@ UPG_CORE_V1_SUFFIX=" \033[32m(full meta core) highly compatible\033[0m \033[33mm
|
||||
UPG_CORE_V1_DOC="Docs: \033[36;4mhttps://wiki.metacubex.one\033[0m"
|
||||
UPG_CORE_V2_PREFIX="2) \033[43;30mSingBoxR\033[0m: \033[32m"
|
||||
UPG_CORE_V2_SUFFIX=" \033[32mfully featured\033[0m \033[33mreF1nd enhanced branch\033[0m"
|
||||
UPG_CORE_V2_DOC="Docs: \033[36;4mhttps://sing-boxr.dustinwin.us.kg\033[0m"
|
||||
UPG_CORE_V2_DOC="Docs: \033[36;4mhttps://sing-boxr.dustinwin.cc.cd\033[0m"
|
||||
UPG_CORE_V3_PREFIX="3) \033[43;30mSingBox\033[0m: \033[32m"
|
||||
UPG_CORE_V3_SUFFIX=" \033[32mlower resource usage\033[0m \033[33mproviders are not supported\033[0m"
|
||||
UPG_CORE_V3_DOC="Docs: \033[36;4mhttps://sing-box.sagernet.org\033[0m"
|
||||
|
||||
@@ -540,7 +540,7 @@ EOF
|
||||
# s自定义singbox配置文件
|
||||
set_singbox_adv() {
|
||||
comp_box "\033[33m$OVR_SING_TITLE1\033[0m" \
|
||||
"\033[36mlog dns ntp certificate experimental\033[0m" \
|
||||
"\033[36mlog dns ntp certificate http_clients experimental\033[0m" \
|
||||
"\033[33m$OVR_SING_TITLE2\033[0m" \
|
||||
"\033[36mendpoints inbounds outbounds providers route services\033[0m" \
|
||||
"$OVR_SING_TITLE3" \
|
||||
|
||||
@@ -92,10 +92,11 @@ EOF
|
||||
],
|
||||
"rules": [
|
||||
{
|
||||
"ip_accept_any": true,
|
||||
"preferred_by": [ "hosts" ],
|
||||
"server": "hosts"
|
||||
}
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
EOF
|
||||
fi
|
||||
@@ -153,7 +154,7 @@ generate_dns_related_jsons() {
|
||||
"format": "binary",
|
||||
$srs_path
|
||||
"url": "https://testingcf.jsdelivr.net/gh/DustinWin/ruleset_geodata@sing-box-ruleset/cn.srs",
|
||||
"download_detour": "DIRECT"
|
||||
"http_client": "detour_direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -217,7 +218,8 @@ EOF
|
||||
generate_route_and_inbounds_jsons() {
|
||||
#生成add_route.json
|
||||
#域名嗅探配置
|
||||
[ "$sniffer" != OFF ] && sniffer_set='{ "domain_suffix": [ "push.apple.com" ], "rule_set": [ "telegramip" ], "domain": [ "Mijia Cloud" ], "invert": true, "action": "sniff", "timeout": "500ms" },'
|
||||
grep -q 'telegramip' "$TMPDIR"/jsons/route.json && telegramip_set=' "rule_set": [ "telegramip" ],'
|
||||
[ "$sniffer" != OFF ] && sniffer_set='{ "domain_suffix": [ "push.apple.com" ],'"$telegramip_set"' "domain": [ "Mijia Cloud" ], "invert": true, "action": "sniff", "timeout": "500ms" },'
|
||||
[ "$ts_service" = ON ] && tailscale_set='{ "inbound": [ "ts-ep" ], "port": 53, "action": "hijack-dns" },'
|
||||
cat >"$TMPDIR"/jsons/add_route.json <<EOF
|
||||
{
|
||||
@@ -225,9 +227,9 @@ generate_route_and_inbounds_jsons() {
|
||||
"default_domain_resolver": "dns_resolver",
|
||||
"default_mark": $routing_mark,
|
||||
"rules": [
|
||||
{ "inbound": [ "dns-in" ], "action": "hijack-dns" },
|
||||
$tailscale_set
|
||||
$sniffer_set
|
||||
{ "inbound": [ "dns-in" ], "action": "hijack-dns" },
|
||||
{ "clash_mode": "Direct" , "outbound": "DIRECT" },
|
||||
{ "clash_mode": "Global" , "outbound": "GLOBAL" }
|
||||
]
|
||||
@@ -324,6 +326,21 @@ generate_outbounds_and_experimental_jsons() {
|
||||
$add_global
|
||||
]
|
||||
}
|
||||
EOF
|
||||
#生成http_clients.json
|
||||
cat >"$TMPDIR"/jsons/http_clients.json <<EOF
|
||||
{
|
||||
"http_clients": [
|
||||
{
|
||||
"tag": "detour_proxy",
|
||||
"detour": "GLOBAL"
|
||||
},
|
||||
{
|
||||
"tag": "detour_direct",
|
||||
"detour": "DIRECT"
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
#生成experimental.json
|
||||
[ "$crashcore" = "singboxr" ] && urltest_unified_delay=',"urltest_unified_delay": true'
|
||||
@@ -394,7 +411,7 @@ link_custom_jsons() {
|
||||
#加载自定义配置文件
|
||||
mkdir -p "$TMPDIR"/jsons_base
|
||||
#以下为覆盖脚本的自定义文件
|
||||
for char in log dns ntp certificate experimental; do
|
||||
for char in log dns ntp certificate http_clients experimental; do
|
||||
[ -s "$CRASHDIR"/jsons/${char}.json ] && {
|
||||
ln -sf "$CRASHDIR"/jsons/${char}.json "$TMPDIR"/jsons/cust_${char}.json
|
||||
mv -f "$TMPDIR"/jsons/${char}.json "$TMPDIR"/jsons_base #如果重复则临时备份
|
||||
|
||||
Reference in New Issue
Block a user