From 8902a742a2c77678b91bf841a05f79f3a5e3db70 Mon Sep 17 00:00:00 2001 From: juewuy Date: Tue, 20 Jan 2026 21:09:07 +0800 Subject: [PATCH] ~bug fix --- scripts/lang/chs/menu.lang | 4 ++-- scripts/lang/en/menu.lang | 22 +++++++++++----------- scripts/menu.sh | 18 +++++++++--------- scripts/menus/2_settings.sh | 19 +++++++++++-------- scripts/menus/9_upgrade.sh | 7 ++----- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/scripts/lang/chs/menu.lang b/scripts/lang/chs/menu.lang index f52be2b5..b84c71e2 100644 --- a/scripts/lang/chs/menu.lang +++ b/scripts/lang/chs/menu.lang @@ -24,6 +24,8 @@ MENU_RUN_ON="正在运行" MENU_RUN_SET="已设置" MENU_RUN_OFF="没有运行" +MENU_PURE_MOD="纯净" +MENU_MOD="模式" MENU_IP_DF="设备IP地址" MENU_AUTOSTART_ON="已设置开机启动!" @@ -34,7 +36,6 @@ MENU_MEM_USED="当前内存占用:" MENU_RUNNING_TIME="已运行:" MENU_TG_CHANNEL="TG频道:" -MENU_TG_URL="https://t.me/ShellClash" # ===== /tmp 文件检测 ===== MENU_TMP_CORE_FOUND="发现可用的内核文件:" @@ -68,7 +69,6 @@ MENU_TEST_LOG_HINT="完整执行记录请查看:" MENU_ERROR_FOUND="发现错误:" # ===== 命令行帮助 ===== -MENU_CLI_WELCOME="欢迎使用ShellCrash" MENU_CLI_TEST="测试模式" MENU_CLI_HELP="帮助列表" diff --git a/scripts/lang/en/menu.lang b/scripts/lang/en/menu.lang index 4e4f1f38..9e3abcbf 100644 --- a/scripts/lang/en/menu.lang +++ b/scripts/lang/en/menu.lang @@ -18,23 +18,24 @@ MENU_OVERRIDE_ASK="Cancel the disable setting?" # ===== Welcome & Status ===== MENU_WELCOME="Welcome to ShellCrash!" -MENU_VERSION_LABEL="Version:" +MENU_VERSION_LABEL="Ver:" -MENU_RUN_ON="Running" +MENU_RUN_ON=" Running" MENU_RUN_SET="Configured" -MENU_RUN_OFF="Not running" +MENU_RUN_OFF="Stopped" +MENU_PURE_MOD="Pure" +MENU_MOD=" Mod" MENU_IP_DF="Device IP Address" -MENU_AUTOSTART_ON="Autostart is enabled!" -MENU_AUTOSTART_OFF="Autostart is disabled!" -MENU_AUTOSTART_DEBUG="Running in debug mode!" +MENU_AUTOSTART_ON="Autostart enable!" +MENU_AUTOSTART_OFF="Autostart disable!" +MENU_AUTOSTART_DEBUG="Debug mode!" -MENU_MEM_USED="Memory usage:" -MENU_RUNNING_TIME="Running time:" +MENU_MEM_USED="Memory usage: " +MENU_RUNNING_TIME="Running time: " -MENU_TG_CHANNEL="Telegram Channel:" -MENU_TG_URL="https://t.me/ShellClash" +MENU_TG_CHANNEL="Telegram Channel: " # ===== /tmp File Detection ===== MENU_TMP_CORE_FOUND="Available core file found:" @@ -69,7 +70,6 @@ MENU_TEST_LOG_HINT="Full execution log can be found at:" MENU_ERROR_FOUND="Error found:" # ===== Command Line Help ===== -MENU_CLI_WELCOME="Welcome to ShellCrash" MENU_CLI_TEST="Test Mode" MENU_CLI_HELP="Help List" diff --git a/scripts/menu.sh b/scripts/menu.sh index b4daade1..c71154b1 100644 --- a/scripts/menu.sh +++ b/scripts/menu.sh @@ -67,7 +67,7 @@ ckstatus() { #脚本启动前检查 versionsh=$(cat "$CRASHDIR"/version) [ -n "$versionsh" ] && versionsh_l=$versionsh - [ -z "$redir_mod" ] && redir_mod="纯净模式" + [ -z "$redir_mod" ] && redir_mod="$MENU_PURE_MOD" #获取本机host地址 [ -z "$host" ] && host=$(ubus call network.interface.lan status 2>&1 | grep \"address\" | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') [ -z "$host" ] && host=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep 'lan' | grep -E ' 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/\/[0-9][0-9].*$//g' | head -n 1) @@ -90,12 +90,12 @@ ckstatus() { #脚本启动前检查 PID=$(pidof CrashCore | awk '{print $NF}') if [ -n "$PID" ]; then - run="\033[32m$MENU_RUN_ON($redir_mod)\033[0m" + run="\033[32m$MENU_RUN_ON($redir_mod$MENU_MOD)\033[0m" running_status elif [ "$firewall_area" = 5 ] && [ -n "$(ip route list table 100)" ]; then - run="\033[32m$MENU_RUN_SET($redir_mod)\033[0m" + run="\033[32m$MENU_RUN_SET($redir_mod$MENU_MOD)\033[0m" else - run="\033[31m$MENU_RUN_OFF($redir_mod)\033[0m" + run="\033[31m$MENU_RUN_OFF($redir_mod$MENU_MOD)\033[0m" #检测系统端口占用 checkport fi @@ -104,14 +104,14 @@ ckstatus() { #脚本启动前检查 [ -f "$TMPDIR"/debug.log -o -f "$CRASHDIR"/debug.log -a -n "$PID" ] && auto="\033[33m$MENU_AUTOSTART_DEBUG\033[0m" #输出状态 echo "-----------------------------------------------" - echo -e "\033[30;46m$MENU_WELCOME\033[0m $MENU_VERSION_LABEL$versionsh_l" - echo -e "$corename $run,$auto" + echo -e "\033[30;46m$MENU_WELCOME\033[0m\t\t$MENU_VERSION_LABEL$versionsh_l" + echo -e "$corename$run\t$auto" if [ -n "$PID" ]; then - echo -e "$MENU_MEM_USED \033[44m$VmRSS\033[0m,$MENU_RUNNING_TIME \033[46;30m$day\033[44;37m$time\033[0m" + echo -e "$MENU_MEM_USED\033[44m$VmRSS\033[0m\t\t$MENU_RUNNING_TIME\033[46;30m$day\033[44;37m$time\033[0m" fi - echo -e "$MENU_TG_CHANNEL \033[36;4m$MENU_TG_URL\033[0m" + echo -e "$MENU_TG_CHANNEL\033[36;4mhttps://t.me/ShellClash\033[0m" echo "-----------------------------------------------" #检查新手引导 if [ -z "$userguide" ]; then @@ -287,7 +287,7 @@ case "$1" in ;; *) echo ----------------------------------------- - echo "$MENU_CLI_WELCOME" + echo "$MENU_WELCOME" echo ----------------------------------------- echo " -t $MENU_CLI_TEST" echo " -h $MENU_CLI_HELP" diff --git a/scripts/menus/2_settings.sh b/scripts/menus/2_settings.sh index 714ed11b..deaef0ec 100644 --- a/scripts/menus/2_settings.sh +++ b/scripts/menus/2_settings.sh @@ -17,7 +17,7 @@ settings() { echo "-----------------------------------------------" echo -e "\033[30;47m$SET_MENU_TITLE\033[0m" echo "-----------------------------------------------" - echo -e " 1 $SET_MENU_REDIR\t\033[36m$redir_mod\033[0m" + echo -e " 1 $SET_MENU_REDIR\t\033[36m$redir_mod$MENU_MOD\033[0m" echo -e " 2 $SET_MENU_DNS\t\033[36m$dns_mod\033[0m" echo -e " 3 $SET_MENU_FW_FILTER" [ "$disoverride" != "1" ] && { @@ -181,10 +181,11 @@ set_redir_mod() { while true; do [ -n "$(ls /dev/net/tun 2>/dev/null)" ] || ip tuntap >/dev/null 2>&1 || modprobe tun 2>/dev/null && sup_tun=1 [ -z "$firewall_area" ] && firewall_area=1 + [ "$firewall_area" = 4 ] && redir_mod="$MENU_PURE_MOD" [ -z "$redir_mod" ] && redir_mod='Redir' firewall_area_dsc=$(echo "$SET_FW_AREA_DESC($bypass_host)" | cut -d'|' -f$firewall_area) echo "-----------------------------------------------" - echo -e "$SET_REDIR_CURRENT \033[47;30m$redir_mod\033[0m ; $SET_CORE_CURRENT \033[47;30m$crashcore\033[0m" + echo -e "$SET_REDIR_CURRENT \033[47;30m$redir_mod$MENU_MOD\033[0m; $SET_CORE_CURRENT \033[47;30m$crashcore\033[0m" echo -e "\033[33m$SET_REDIR_RESTART_HINT\033[0m" echo "-----------------------------------------------" [ $firewall_area -le 3 ] && { @@ -460,12 +461,14 @@ set_firewall_area() { case "$num" in [1-4]) - [ $firewall_area -ge 4 ] && { - redir_mod=Redir - setconfig redir_mod $redir_mod - } - firewall_area=$num - setconfig firewall_area $firewall_area + if [ $firewall_area -ge 4 ];then + redir_mod='' + else + redir_mod=Redir + fi + firewall_area="$num" + setconfig firewall_area "$firewall_area" + setconfig redir_mod "$redir_mod" ;; 5) echo "-----------------------------------------------" diff --git a/scripts/menus/9_upgrade.sh b/scripts/menus/9_upgrade.sh index 517e4780..5c2f5d37 100644 --- a/scripts/menus/9_upgrade.sh +++ b/scripts/menus/9_upgrade.sh @@ -679,7 +679,7 @@ getgeo() { [ ! -d "$BINDIR"/ruleset ] && mkdir -p "$BINDIR"/ruleset } if echo "$geoname" | grep -Eq '.tar.gz'; then - tar -zxf "$TMPDIR"/"${geoname}" "${tar_para}" -C "$BINDIR"/"${geofile}" >/dev/null + tar -zxf "$TMPDIR"/"${geoname}" ${tar_para} -C "$BINDIR"/"${geofile}" >/dev/null if [ $? -ne 0 ]; then content_line "文件解压失败!" separator_line "=" @@ -975,7 +975,7 @@ getdb() { else content_line "\033[33m下载成功,正在解压文件......\033[0m" mkdir -p "$dbdir" >/dev/null - tar -zxf "$TMPDIR/clashdb.tar.gz" "${tar_para}" -C "$dbdir" >/dev/null + tar -zxf "$TMPDIR/clashdb.tar.gz" ${tar_para} -C "$dbdir" >/dev/null if [ $? -ne 0 ]; then content_line "文件解压失败!" separator_line "=" @@ -1079,14 +1079,11 @@ setdb() { content_line "1) 安装\033[32mzashboard面板\033[0m(约2.2mb)" content_line "2) 安装\033[32mMetaXD面板\033[0m(约1.5mb)" content_line "3) 安装\033[32mYacd-Meta魔改面板\033[0m(约1.7mb)" - content_line "" content_line " - - - - - -已停止维护- - - - - -" content_line "4) 安装\033[32m基础面板\033[0m(约500kb)" content_line "5) 安装\033[32mMeta基础面板\033[0m(约800kb)" content_line "6) 安装\033[32mYacd面板\033[0m(约1.1mb)" - content_line "" content_line "9) \033[31m卸载本地面板\033[0m" - content_line "" content_line "0) 返回上级菜单" separator_line "="