mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-10 23:41:22 +00:00
~优化容器体验,现在首次启动成功会自动设置自启
~简化Singbox内核dns模块语法 ~优化Mihomo内核配置文件覆写,现在支持自动引入sub-rules、listeners字段 ~修复因urlencode导致的在线订阅更新失败的bug ~修复部分老旧设备调用wget下载时报错的bug
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,4 @@
|
||||
meta_v=v1.19.17
|
||||
singboxr_v=1.13.0-alpha.27
|
||||
versionsh=1.9.3beta9
|
||||
versionsh=1.9.3pre1
|
||||
GeoIP_v=20251205
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) Juewuy
|
||||
|
||||
version=1.9.3beta9
|
||||
version=1.9.3pre1
|
||||
|
||||
setdir() {
|
||||
dir_avail() {
|
||||
|
||||
@@ -295,7 +295,7 @@ urlencode() {
|
||||
| hexdump -v -e '/1 "%02X\n"' \
|
||||
| while read -r hex; do
|
||||
case "$hex" in
|
||||
2D|2E|5F|7E|3[0-9]|4[1-9A-F]|5[A-F]|6[1-9A-F]|7[0-9A-E])
|
||||
2D|2E|5F|7E|3[0-9]|4[1-9A-F]|5[0-9A]|6[1-9A-F]|7[0-9A-E])
|
||||
printf "\\$(printf '%03o' "0x$hex")"
|
||||
;;
|
||||
*)
|
||||
@@ -558,7 +558,7 @@ EOF
|
||||
fi
|
||||
fi
|
||||
#分割配置文件
|
||||
yaml_char='proxies proxy-groups proxy-providers rules rule-providers'
|
||||
yaml_char='proxies proxy-groups proxy-providers rules rule-providers sub-rules listeners'
|
||||
for char in $yaml_char; do
|
||||
sed -n "/^$char:/,/^[a-z]/ { /^[a-z]/d; p; }" $core_config >"$TMPDIR"/${char}.yaml
|
||||
done
|
||||
@@ -830,10 +830,8 @@ EOF
|
||||
"default_domain_resolver": "dns_resolver",
|
||||
"default_mark": $routing_mark,
|
||||
"rules": [
|
||||
{ "inbound": [ "dns-in" ], "action": "sniff", "timeout": "500ms" },
|
||||
{ "inbound": [ "dns-in" ], "action": "hijack-dns" },
|
||||
$sniffer_set
|
||||
{ "protocol": "dns", "action": "hijack-dns" },
|
||||
{ "inbound": [ "dns-in" ], "action": "reject" },
|
||||
{ "clash_mode": "Direct" , "outbound": "DIRECT" },
|
||||
{ "clash_mode": "Global" , "outbound": "GLOBAL" }
|
||||
]
|
||||
@@ -2066,7 +2064,10 @@ start)
|
||||
systemctl start shellcrash.service || start_error
|
||||
}
|
||||
elif grep -q 's6' /proc/1/comm; then
|
||||
bfstart && /command/s6-svc -u /run/service/shellcrash && afstart &
|
||||
bfstart && /command/s6-svc -u /run/service/shellcrash && {
|
||||
[ ! -f "$CRASHDIR"/.dis_startup ] && touch /etc/s6-overlay/s6-rc.d/user/contents.d/afstart
|
||||
afstart &
|
||||
}
|
||||
elif rc-status -r >/dev/null 2>&1; then
|
||||
rc-service shellcrash stop >/dev/null 2>&1
|
||||
rc-service shellcrash start
|
||||
@@ -2170,7 +2171,7 @@ webget)
|
||||
#参数【$4】代表输出显示,【$5】不启用重定向
|
||||
#参数【$6】代表验证证书,【$7】使用自定义UA
|
||||
[ -n "$7" ] && agent="--user-agent \"$7\""
|
||||
if wget --version >/dev/null 2>&1; then
|
||||
if wget --help 2>&1 | grep -q 'show-progress' >/dev/null 2>&1; then
|
||||
[ "$4" = "echooff" ] && progress='-q' || progress='-q --show-progress'
|
||||
[ "$5" = "rediroff" ] && redirect='--max-redirect=0' || redirect=''
|
||||
[ "$6" = "skipceroff" ] && certificate='' || certificate='--no-check-certificate'
|
||||
|
||||
@@ -523,7 +523,7 @@ EOF
|
||||
#调用内核测试
|
||||
${CRASHDIR}/start.sh core_check && ${TMPDIR}/CrashCore merge ${TMPDIR}/config.json -C ${TMPDIR}/providers
|
||||
if [ "$?" = 0 ];then
|
||||
echo -e "\033[32m配置文件生成成功!\033[0m"
|
||||
echo -e "\033[32m配置文件生成成功!如果启动超时建议更新里手动安装Singbox-srs数据库常用包!\033[0m"
|
||||
mkdir -p ${CRASHDIR}/jsons
|
||||
mv -f ${TMPDIR}/config.json ${CRASHDIR}/jsons/config.json
|
||||
rm -rf ${TMPDIR}/providers
|
||||
@@ -934,7 +934,7 @@ gen_core_config_link(){ #在线生成工具
|
||||
echo -e " 0 \033[31m撤销输入并返回上级菜单\033[0m"
|
||||
echo "-----------------------------------------------"
|
||||
read -p "请直接输入第${i}个链接或对应数字选项 > " link
|
||||
link=$(echo $link | sed 's/\&/%26/g') #处理分隔符
|
||||
link=$(echo $link | sed 's/\&/\\&/g') #处理分隔符
|
||||
test=$(echo $link | grep "://")
|
||||
link=`echo ${link/\#*/''}` #删除链接附带的注释内容
|
||||
link=`echo ${link/\ \(*\)/''}` #删除恶心的超链接内容
|
||||
|
||||
Reference in New Issue
Block a user