From 64722827500830a3f97e9c5a973c8c3dfc6724a2 Mon Sep 17 00:00:00 2001 From: juewuy Date: Tue, 20 Feb 2024 18:44:27 +0800 Subject: [PATCH] =?UTF-8?q?~singbox=E4=B8=8B=E5=8F=91fakeip=E7=9A=84dns?= =?UTF-8?q?=E6=97=B6=EF=BC=8Cttl=E4=BF=AE=E6=94=B9=E4=B8=BA1=20~=E4=BC=98?= =?UTF-8?q?=E5=8C=96meta=E5=92=8Cpremium=E5=86=85=E6=A0=B8=E7=9A=84?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E5=97=85=E6=8E=A2=E8=AE=BE=E7=BD=AE=20~?= =?UTF-8?q?=E4=BC=98=E5=8C=96singbox=E5=86=85=E6=A0=B8mix=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E7=9A=84geo=E5=88=86=E6=B5=81=E8=A7=84=E5=88=99?= =?UTF-8?q?=E4=B8=BAgeolocation-cn=E4=BB=A5=E4=BF=AE=E5=A4=8DGooglePlay?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=20~=E5=A2=9E=E5=8A=A0=E6=9C=AC=E6=9C=BA?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E8=AD=A6=E5=91=8A=E6=8F=90=E7=A4=BA=20~?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=AF=E5=8A=A8=E5=90=8E=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=9C=B0=E5=9D=80=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/menu.sh | 13 +++++++++++-- scripts/start.sh | 10 +++++----- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/scripts/menu.sh b/scripts/menu.sh index f909f81..8c4f479 100644 --- a/scripts/menu.sh +++ b/scripts/menu.sh @@ -47,8 +47,13 @@ ckstatus(){ [ -z "$host" ] && host=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep -E ' 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1) [ -z "$host" ] && host='设备IP地址' #dashboard目录位置 - [ -f ${CRASHDIR}/ui/index.html ] && dbdir=${CRASHDIR}/ui && hostdir=":$db_port/ui" - [ -f /www/clash/index.html ] && dbdir=/www/clash && hostdir=/clash + if [ -f /www/clash/index.html ];then + dbdir=/www/clash + hostdir=/clash + else + dbdir=${CRASHDIR}/ui + hostdir=":$db_port/ui" + fi #开机自启检测 if [ -f /etc/rc.common -a "$(cat /proc/1/comm)" = "procd" ];then [ -n "$(find /etc/rc.d -name '*shellcrash')" ] && autostart=enable || autostart=disable @@ -922,6 +927,10 @@ localproxy(){ #本机代理 [ -w /etc/systemd/system/shellcrash.service -o -w /usr/lib/systemd/system/shellcrash.service -o -x /bin/su ] && local_enh=1 [ -f /etc/rc.common -a "$(cat /proc/1/comm)" = "procd" ] && [ -w /etc/passwd ] && local_enh=1 echo ----------------------------------------------- + echo -e "\033[31m注意:\033[0m如果你不了解Linux系统的流量机制及$crashcore内核的流量劫持机制" + echo -e "启用此功能将可能导致\033[31m流量回环乃至设备死机\033[0m等严重问题!!!" + echo -e "\033[33m如你使用了第三方DNS如smartdns等,请务必禁用此功能或者使用shellcrash用户执行!\033[0m" + sleep 1 [ -n "$local_enh" ] && { ckcmd iptables && [ -n "$(iptables -m owner --help | grep owner)" ] && echo -e " 1 使用\033[32miptables增强模式\033[0m配置(支持docker,推荐!)" nft add table inet shellcrash 2>/dev/null && echo -e " 2 使用\033[32mnftables增强模式\033[0m配置(支持docker,推荐!)" diff --git a/scripts/start.sh b/scripts/start.sh index 98a5841..00dd945 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -382,8 +382,8 @@ EOF } } #域名嗅探配置 - [ "$sniffer" = "已启用" ] && [ "$crashcore" = "meta" ] && sniffer_set="sniffer: {enable: true, skip-domain: [Mijia Cloud], sniff: {tls: {ports: [443, 8443]}, http: {ports: [80, 8080-8880]}}}" - [ "$crashcore" = "clashpre" ] && [ "$dns_mod" = "redir_host" ] && exper="experimental: {ignore-resolve-fail: true, interface-name: en0, sniff-tls-sni: true}" + [ "$sniffer" = "已启用" ] && [ "$crashcore" = "meta" ] && sniffer_set="sniffer: {enable: true, parse-pure-ip: true, skip-domain: [Mijia Cloud], sniff: {tls: {ports: [443, 8443]}, http: {ports: [80, 8080-8880]}}}" + [ "$crashcore" = "clashpre" ] && [ "$dns_mod" = "redir_host" -o "$sniffer" = "已启用" ] && exper="experimental: {ignore-resolve-fail: true, interface-name: en0, sniff-tls-sni: true}" #生成set.yaml cat > ${TMPDIR}/set.yaml </dev/null | grep '\.' | awk '{printf "\"%s\", ",$1}' | sed "s/, $//" | sed 's/+/.+/g' | sed 's/*/.*/g') [ -n "$fake_ip_filter" ] && fake_ip_filter="{ \"domain_regex\": [$fake_ip_filter], \"server\": \"local\" }," if [ -z "$(echo "$core_v" | grep -E '^1\.7.*')" ];then - mix_dns="{ \"rule_set\": [\"geosite-cn\"], \"invert\": true, \"server\": \"dns_fakeip\" }," + mix_dns="{ \"rule_set\": [\"geosite-cn\"], \"invert\": true, \"server\": \"dns_fakeip\", \"rewrite_ttl\": 1 }," #生成add_rule_set.json [ -z "$(cat ${CRASHDIR}/jsons/*.json | grep -Ei '\"tag\" *: *\"geosite-cn\"')" ] && cat > ${TMPDIR}/jsons/add_rule_set.json < ${TMPDIR}/jsons/dns.json <