From a2896f3c94cdf8750ec20dfb2e10e2c030fd0060 Mon Sep 17 00:00:00 2001 From: heinu Date: Tue, 16 Apr 2024 13:32:52 +0800 Subject: [PATCH] fix update clash(alpha) error --- module/clash/clash.config | 4 ++-- module/clash/scripts/clash.tool | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/module/clash/clash.config b/module/clash/clash.config index 48988c1..fb337eb 100755 --- a/module/clash/clash.config +++ b/module/clash/clash.config @@ -51,7 +51,7 @@ Clash_port_skipdetection="true" WaitClashStartTime="4" # 等待clash启动时间(单位:秒),过短会导致端口检测误判(跳过端口检查时无效) -ghproxy="https://mirror.ghproxy.com" +ghproxy="https://mirror.ghproxy.com/" # 设置github代理 ipspeed="https://fast.com" @@ -105,7 +105,7 @@ Cgroup_memory_limit="" pref_id="5000" mark_id="2021" table_id="2021" -version="202404161321" +version="202404161330" Cgroup_memory_path="" Clash_data_dir="/data/clash" Clash_run_path="${Clash_data_dir}/run" diff --git a/module/clash/scripts/clash.tool b/module/clash/scripts/clash.tool index f5148e3..ad8707e 100755 --- a/module/clash/scripts/clash.tool +++ b/module/clash/scripts/clash.tool @@ -108,7 +108,11 @@ upgrade_clash() { else specific_clash_filename=${general_clash_filename}${remote_clash_ver} fi - curl --connect-timeout 5 -Ls -o ${Clash_data_dir}/clashkernel/temp/clashMeta.gz "${ghproxy}/https://github.com/MetaCubeX/mihomo/releases/latest/download/${specific_clash_filename}.gz" + if [ ${alpha} == "true" ];then + curl --connect-timeout 5 -Ls -o ${Clash_data_dir}/clashkernel/temp/clashMeta.gz "${ghproxy}https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/${specific_clash_filename}.gz" + else + curl --connect-timeout 5 -Ls -o ${Clash_data_dir}/clashkernel/temp/clashMeta.gz "${ghproxy}https://github.com/MetaCubeX/mihomo/releases/latest/download/${specific_clash_filename}.gz" + fi unset remote_clash_ver unset general_clash_filename unset specific_clash_filename @@ -135,9 +139,9 @@ upgrade_clash() { check_clash_ver() { if [[ "${alpha}" == "true" ]];then - remote_clash_ver=$(curl --connect-timeout 5 -Ls "${ghproxy}/https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/version.txt") + remote_clash_ver=$(curl --connect-timeout 5 -Ls "${ghproxy}https://github.com/MetaCubeX/mihomo/releases/download/Prerelease-Alpha/version.txt") else - remote_clash_ver=$(curl --connect-timeout 5 -Ls "${ghproxy}/https://github.com/MetaCubeX/mihomo/releases/latest/download/version.txt") + remote_clash_ver=$(curl --connect-timeout 5 -Ls "${ghproxy}https://github.com/MetaCubeX/mihomo/releases/latest/download/version.txt") fi if [[ "${remote_clash_ver}" == "" ]];then unset remote_clash_ver