Skip to content

Commit

Permalink
fix update clash(alpha) error
Browse files Browse the repository at this point in the history
  • Loading branch information
elysias123 committed Apr 16, 2024
1 parent cc361fd commit a2896f3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions module/clash/clash.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
10 changes: 7 additions & 3 deletions module/clash/scripts/clash.tool
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a2896f3

Please sign in to comment.