From d6eb83ac30511abe823e5e7212c48907ee7d728f Mon Sep 17 00:00:00 2001 From: RikusouPatrickstar <68163551+RikudouPatrickstar@users.noreply.github.com> Date: Fri, 14 Apr 2023 21:15:15 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=20meta=20=E5=86=85=E6=A0=B8?= =?UTF-8?q?=E7=9A=84=E4=B8=A4=E8=A1=8C=E7=89=88=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/update_meta.alpha_core.yaml | 2 +- .github/workflows/update_meta_core.yaml | 2 +- scripts/getdate.sh | 2 +- scripts/start.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/update_meta.alpha_core.yaml b/.github/workflows/update_meta.alpha_core.yaml index 78f03f3c6..599a2fe10 100644 --- a/.github/workflows/update_meta.alpha_core.yaml +++ b/.github/workflows/update_meta.alpha_core.yaml @@ -55,7 +55,7 @@ jobs: ./tmp/* - name: Commit and push version run: | - sed -i "s/meta.a_v=.*/meta.a_v=${download_version}/" bin/version + sed -i "s/meta.a_v=.*/meta.a_v=$(./tmp/clash-linux-amd64 -v 2>/dev/null | head -n 1 | sed 's/ linux.*//;s/.* //')/" bin/version rm -fr ./tmp git config --global user.email "juewuy@126.com" && git config --global user.name "Bot" git add . && git commit -m "更新Meta.Alpha内核至${download_version}" || exit 0 diff --git a/.github/workflows/update_meta_core.yaml b/.github/workflows/update_meta_core.yaml index 941e165a0..6af56b195 100644 --- a/.github/workflows/update_meta_core.yaml +++ b/.github/workflows/update_meta_core.yaml @@ -50,7 +50,7 @@ jobs: rm -fr ./bin/clash.meta/* cp ./tmp/* ./bin/clash.meta/ rm -fr ./tmp - sed -i "s/meta_v=.*/meta_v=$(./bin/clash.meta/clash-linux-amd64 -v 2>/dev/null | sed 's/ linux.*//;s/.* //')/" bin/version + sed -i "s/meta_v=.*/meta_v=$(./bin/clash.meta/clash-linux-amd64 -v 2>/dev/null | head -n 1 | sed 's/ linux.*//;s/.* //')/" bin/version - name: Commit and push run: | git config --global user.email "juewuy@gmail.com" && git config --global user.name "Bot" diff --git a/scripts/getdate.sh b/scripts/getdate.sh index 92b3e60da..7860be605 100644 --- a/scripts/getdate.sh +++ b/scripts/getdate.sh @@ -843,7 +843,7 @@ update(){ [ "$clashcore" = "clashpre" ] && clash_n=$clashpre_v [ "$clashcore" = "clash.net" ] && clash_n=$clashnet_v [ "$clashcore" = "clash.meta" ] && clash_n=$meta_v - clash_v=$($bindir/clash -v 2>/dev/null | sed 's/ linux.*//;s/.* //') + clash_v=$($bindir/clash -v 2>/dev/null | head -n 1 | sed 's/ linux.*//;s/.* //') [ -z "$clash_v" ] && clash_v=$clashv echo -e "\033[30;47m欢迎使用更新功能:\033[0m" echo ----------------------------------------------- diff --git a/scripts/start.sh b/scripts/start.sh index 2dafbbed7..bc13fc107 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -1119,7 +1119,7 @@ bfstart(){ $0 webget $bindir/clash "$update_url/bin/$clashcore/clash-linux-$cpucore" #校验内核 chmod +x $bindir/clash 2>/dev/null - clashv=$($bindir/clash -v 2>/dev/null | sed 's/ linux.*//;s/.* //') + clashv=$($bindir/clash -v 2>/dev/null | head -n 1 | sed 's/ linux.*//;s/.* //') if [ -z "$clashv" ];then rm -rf $bindir/clash logger "核心下载失败,请重新运行或更换安装源!" 31