在新开的 woiden 上执行用 ghproxy 处理的 xray 安装脚本 安装 prerelease 版本 成了 1.4.0 版本
新开了一个
执行用
bash <(curl -L https://ghproxy.crazypeace.workers.dev/https://github.com/crazypeace/xray-vless-reality/raw/main/install.sh | perl -pe "$(curl -L https://ghproxy.crazypeace.workers.dev/perl-pe-para)") auto 8443
报错说 xray x25519 未知命令.
bash 带上 -x 参数, 查了一下安装过程, 发现
细查
安装之前的脚本是
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install --beta
用
bash -c "$(curl -L https://ghproxy.crazypeace.workers.dev/https://github.com/XTLS/Xray-install/raw/main/install-release.sh | perl -pe "$(curl -L https://ghproxy.crazypeace.workers.dev/perl-pe-para)")" @ install --beta
查了一下转换之后的脚本内容
curl -L https://ghproxy.crazypeace.workers.dev/https://github.com/XTLS/Xray-install/raw/main/install-release.sh | perl -pe "$(curl -L https://ghproxy.crazypeace.workers.dev/perl-pe-para)" > tmp.sh
再和转换之前的脚本内容比较, 发现处理
处理前,
if ! curl -x "${PROXY}" -R -H 'Cache-Control: no-cache' -o "${dir_tmp}/${2}.sha256sum" "${1}.sha256sum"; then
处理后
if ! curl -x "${PROXY}" -R -H 'Cache-Control: no-cache' -o "${dir_tmp}/${2}.sh | perl -pe "$(curl -L https://ghproxy.crazypeace.workers.dev/perl-pe-para)" a256sum" "${1}.sha256sum"; then
对应的 https://ghproxy.crazypeace.workers.dev/perl-pe-para 的内容:
s#(curl.*?\.sh)([^/])#\1 | perl -pe "\$(curl -L https://ghproxy.crazypeace.workers.dev/perl-pe-para)" \2#g; s# (git)# https://\1#g; s#(http.*?git[^/]*?/)#https://ghproxy.crazypeace.workers.dev/\1#g
前面部分的匹配部分不够严谨.
修改为:
s#(curl.*?\.sh)([^/\d\w])#\1 | perl -pe "\$(curl -L https://ghproxy.crazypeace.workers.dev/perl-pe-para)" \2#g; s# (git)# https://\1#g; s#(http.*?git[^/]*?/)#https://ghproxy.crazypeace.workers.dev/\1#g
再检验一下结果, 发现还是安装的
再查, 如果不是 --beta 参数的话, 是正常的. 但加上 --beta 参数后, 就安装成了
走读 https://github.com/XTLS/Xray-install/blob/main/install-release.sh 脚本. 原来逻辑是这样的:
(1) 先从 https://api.github.com/repos/XTLS/Xray-core/releases 得到全部的版本号,
(2) 然后用版本号和操作系统拼装下载链接,
(3) 再用下载链接去
releases 查找有没有, 如果找不到, 那就换下一个版本号尝试.
我想了一下, 这个逻辑应该是为了解决这样的情况, 如果预发布的版本
在脚本被 ghproxy 页面处理过后, 第
用
+ for i in ${!releases_list[@]}+ releases_list[$i]=v1.8.3+ grep -q https://ghproxy.crazypeace.workers.dev/https://github.com/XTLS/Xray-core/releases/download/v1.8.3/Xray-linux-64.zip /tmp/tmp.YMjNLZwtAE
解决方案, 不使用 --beta 参数, 改为使用 --version
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install --version 1.8.3
已提交 Github
评论
发表评论