From e8651591ff419faa371b2516dc85cf6df742c0db Mon Sep 17 00:00:00 2001 From: juewuy Date: Wed, 21 Jan 2026 19:15:49 +0800 Subject: [PATCH] =?UTF-8?q?~=E4=BC=98=E5=8C=96=E6=B5=8B=E8=AF=95=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=91=BD=E4=BB=A4=20~=E4=BC=98=E5=8C=96=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=9B=9E=E9=80=80=E5=8A=9F=E8=83=BD=EF=BC=8C=E7=8E=B0?= =?UTF-8?q?=E5=9C=A8=E6=94=AF=E6=8C=81=E5=9B=9E=E9=80=80=E5=88=B0=E8=BF=91?= =?UTF-8?q?=E6=9C=9Ftags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/menu.sh | 20 +++++++++++++------- scripts/menus/9_upgrade.sh | 15 ++++++++------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/scripts/menu.sh b/scripts/menu.sh index c71154b1..35347807 100644 --- a/scripts/menu.sh +++ b/scripts/menu.sh @@ -248,24 +248,30 @@ case "$1" in main_menu ;; -t) - shtype=sh && [ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash - $shtype -x "$CRASHDIR"/menu.sh + shtype=sh + [ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash + "$shtype" -x "$CRASHDIR"/menu.sh ;; -s) - "$CRASHDIR"/start.sh $2 $3 $4 $5 $6 + "$CRASHDIR"/start.sh "$2" "$3" "$4" "$5" "$6" ;; -i) . "$CRASHDIR"/init.sh 2>/dev/null ;; -st) - shtype=sh && [ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash - $shtype -x "$CRASHDIR"/start.sh $2 $3 $4 $5 $6 + shtype=sh + ckcmd bash && shtype=bash + "$shtype" -x "$CRASHDIR"/starts/bfstart.sh + . "$CRASHDIR"/starts/start_legacy.sh + start_legacy "$COMMAND" 'shellcrash' + "$shtype" -x "$CRASHDIR"/starts/afstart.sh + "$CRASHDIR"/start.sh stop ;; -d) shtype=sh && [ -n "$(ls -l /bin/sh | grep -o dash)" ] && shtype=bash echo -e "$MENU_TEST_RUNNING\033[32;4mt.me/ShellClash\033[0m" - $shtype "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh_bug.log - $shtype -x "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh.log + "$shtype" "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh_bug.log + "$shtype" -x "$CRASHDIR"/start.sh debug >/dev/null 2>"$TMPDIR"/debug_sh.log echo ----------------------------------------- cat "$TMPDIR"/debug_sh_bug.log | grep 'start\.sh' >"$TMPDIR"/sh_bug if [ -s "$TMPDIR"/sh_bug ]; then diff --git a/scripts/menus/9_upgrade.sh b/scripts/menus/9_upgrade.sh index 5c2f5d37..256bbadd 100644 --- a/scripts/menus/9_upgrade.sh +++ b/scripts/menus/9_upgrade.sh @@ -1374,16 +1374,17 @@ setserver() { separator_line "=" if [ -n "$url_id" ] && [ "$url_id" -lt 200 ]; then content_line "\033[32m正在获取版本信息......\033[0m" - get_bin "$TMPDIR"/release_version bin/release_version - if [ "$?" = "0" ]; then + . "$CRASHDIR"/libs/web_get_lite.sh + web_get_lite https://github.com/juewuy/ShellCrash/tags | grep -o 'releases/tag/.*data'|awk -F '/' '{print $3}'|sed 's/".*//g' > "$TMPDIR"/tags + if [ "$?" = "0" ]; then content_line "\033[32m获取版本信息成功\033[0m" separator_line "=" line_break separator_line "=" - content_line "\033[31m请选择想要回退至的稳定版版本:\033[0m" + content_line "\033[31m请选择想要回退至的具体版本:\033[0m" - cat "$TMPDIR"/release_version | + cat "$TMPDIR"/tags | awk '{print NR") "$1}' | while IFS= read -r line; do content_line "$line" @@ -1394,8 +1395,8 @@ setserver() { read -r -p "请输入对应标号> " num if [ -z "$num" ] || [ "$num" = 0 ]; then continue - elif [ "$num" -le $(cat "$TMPDIR"/release_version 2>/dev/null | awk 'END{print NR}') ]; then - release_type=$(cat "$TMPDIR"/release_version | awk '{print $1}' | sed -n "$num"p) + elif [ "$num" -le $(cat "$TMPDIR"/tags 2>/dev/null | awk 'END{print NR}') ]; then + release_type=$(cat "$TMPDIR"/tags | awk '{print $1}' | sed -n "$num"p) update_url='' saveserver else @@ -1409,7 +1410,7 @@ setserver() { sleep 1 continue fi - rm -rf "$TMPDIR"/release_version + rm -rf "$TMPDIR"/tags else content_line "\033[31m当前源不支持版本回退\033[0m" content_line "\033[31m请尝试更换其他安装源!\033[0m"