diff --git a/scripts/libs/core_tools.sh b/scripts/libs/core_tools.sh index 39f54253..4bd1decb 100644 --- a/scripts/libs/core_tools.sh +++ b/scripts/libs/core_tools.sh @@ -72,8 +72,11 @@ core_webget(){ [ -z "$zip_type" ] && zip_type='tar.gz' get_bin "$TMPDIR/Coretmp.$zip_type" "bin/$crashcore/${target}-linux-${cpucore}.$zip_type" else - zip_type=$(echo "$custcorelink" | grep -oE 'tar.gz$') - [ -z "$zip_type" ] && zip_type=$(echo "$custcorelink" | grep -oE 'gz$') + case "$custcorelink" in + *.tar.gz) zip_type="tar.gz" ;; + *.gz) zip_type="gz" ;; + *.upx) zip_type="upx" ;; + esac [ -n "$zip_type" ] && webget "$TMPDIR/Coretmp.$zip_type" "$custcorelink" fi #校验内核 diff --git a/scripts/menus/7_gateway.sh b/scripts/menus/7_gateway.sh index d44618d0..6a36a976 100644 --- a/scripts/menus/7_gateway.sh +++ b/scripts/menus/7_gateway.sh @@ -225,6 +225,7 @@ set_bot_tg() { comp_box "\033[31m注意:\033[0m由于网络环境原因,此机器人仅限服务启动时运行!" btm_box "1) 启用/关闭TG-BOT服务 \033[32m$bot_tg_service\033[0m" \ "2) TG-BOT绑定设置 \033[32m$TG_CHATID_info\033[0m" \ + "3) 启动时推送菜单 \033[32m$TG_menupush\033[0m" \ "" \ "0) 返回上级菜单" read -r -p "请输入对应标号> " num @@ -255,6 +256,15 @@ set_bot_tg() { fi set_bot_tg_init ;; + 3) + if [ "$TG_menupush" = ON ];then + TG_menupush=OFF + else + TG_menupush=ON + fi + setconfig TG_menupush "$TG_menupush" "$GT_CFG_PATH" + set_bot_tg + ;; *) errornum ;; diff --git a/scripts/menus/9_upgrade.sh b/scripts/menus/9_upgrade.sh index b5c324e7..dd28b10c 100644 --- a/scripts/menus/9_upgrade.sh +++ b/scripts/menus/9_upgrade.sh @@ -440,7 +440,7 @@ setcustcore() { ;; 9) comp_box "请输入自定义内核的链接地址" \ - "(必须是以.tar.gz或.gz结尾的压缩文件)" \ + "(必须是以.tar.gz、.upx或.gz结尾的压缩文件)" \ "" \ "或者输入 0 返回上级菜单" read -r -p "请输入> " link @@ -495,7 +495,7 @@ setcore() { [ -z "$crashcore" ] && crashcore="unknow" [ -z "$zip_type" ] && zip_type="tar.gz" echo "$crashcore" | grep -q 'singbox' && core_old=singbox || core_old=clash - [ -n "$custcorelink" ] && custcore="$(echo "$custcorelink" | sed 's#.*github.com##; s#/releases/download/#@#; s#-linux.*$##')" + [ -n "$custcorelink" ] && custcore="$(echo "$custcorelink" | sed 's#.*github.com##; s#/releases/download/#@#')" [ -z "$cpucore" ] && check_cpucore diff --git a/scripts/menus/bot_tg.sh b/scripts/menus/bot_tg.sh index a54638cd..c3ac471f 100644 --- a/scripts/menus/bot_tg.sh +++ b/scripts/menus/bot_tg.sh @@ -320,7 +320,7 @@ polling(){ done } -#send_menu +[ "$TG_menupush" = ON ] && send_menu polling diff --git a/scripts/menus/fw_filter.sh b/scripts/menus/fw_filter.sh index 11addd71..0dd4ecfc 100644 --- a/scripts/menus/fw_filter.sh +++ b/scripts/menus/fw_filter.sh @@ -15,7 +15,7 @@ set_fw_filter() { comp_box "1) 过滤非常用端口: \033[36m$common_ports\033[0m ———用于过滤P2P流量" \ "2) 过滤局域网设备: \033[36m$mac_return\033[0m ———使用黑/白名单进行过滤" \ "3) 过滤QUIC协议: \033[36m$quic_rj\033[0m ———优化视频性能" \ - "4) 过滤CN_IP(4/6)列表:\033[36m$cn_ip_route\033[0m ———优化性能" \ + "4) 过滤CN_IP(4&6)列表:\033[36m$cn_ip_route\033[0m ———优化性能" \ "5) 自定义透明路由ipv4网段:适合vlan等复杂网络环境" \ "6) 自定义保留地址ipv4网段:需要以保留地址为访问目标的环境" \ "" \ diff --git a/scripts/starts/clash_check.sh b/scripts/starts/clash_check.sh index f74a85d6..93460537 100644 --- a/scripts/starts/clash_check.sh +++ b/scripts/starts/clash_check.sh @@ -11,10 +11,10 @@ clash_check() { #clash启动前检查 [ "$crashcore" = "clash" ] && [ "$firewall_area" = 2 -o "$firewall_area" = 3 ] && [ -z "$(grep '0:7890' /etc/passwd)" ] && core_exchange meta '当前内核不支持非root用户启用本机代理' check_core - #预下载GeoIP数据库并排除存在自定义数据库链接的情况 - [ -n "$(grep -oEi 'geoip:' "$CRASHDIR"/yamls/config.yaml)" ] && check_geo Country.mmdb cn_mini.mmdb - #预下载GeoSite数据库并排除存在自定义数据库链接的情况 - [ -n "$(grep -oEi 'geosite:' "$CRASHDIR"/yamls/config.yaml)" ] && check_geo GeoSite.dat geosite.dat + #预下载GeoIP数据库 + grep -qEi 'GEOIP,CN' "$CRASHDIR"/yamls/config.yaml && ! grep -Eq '^[[:space:]]*geodata-mode:' "$CRASHDIR"/yamls/*.yaml && check_geo Country.mmdb cn_mini.mmdb + #预下载GeoSite数据库 + grep -qEi 'GEOSITE,' "$CRASHDIR"/yamls/config.yaml && ! grep -Eq '^[[:space:]]*geosite:' "$CRASHDIR"/yamls/*.yaml && check_geo GeoSite.dat geosite.dat #预下载cn.mrs数据库 [ "$dns_mod" = "mix" ] || [ "$dns_mod" = "route" ] && ! grep -Eq '^[[:space:]]*cn:' "$CRASHDIR"/yamls/*.yaml && check_geo ruleset/cn.mrs mrs_geosite_cn.mrs return 0