GitHub Proxy 更新 支持在一行内 wget 下载再执行的形式
现象
一直以来, 在各种地方不断地看到在不同的环境下跑
有些一键脚本的作者为了美观装B)
这样, 如果出错就一点显示都没有. 对不懂的小白来说, 连用微信扫一扫翻译错误信息的机会都没有.
比如, 这位仁兄
出错的原因
可能是
可能是
解决方案
我思考的解决方案就是换一条路去访问
比如, Cloudflare
考虑到国内网络的情况, 我发现 Replit 的域名没被墙, 我又写了一篇在Replit
Feedback
以前我还考虑到会有
我也在一些
有些一键脚本的作者考虑到 wget 的形式会保存一份脚本文件在
比如:
wget -O tcpx.sh "https://git.io/JYxKU" && chmod +x tcpx.sh && ./tcpx.sh
wget -N --no-check-certificate https://raw.githubusercontent.com/Misaka-blog/hysteria-install/main/hy2/hysteria.sh && bash hysteria.sh
那么我想, 好吧, 如果不考虑嵌套调用的情况; 不考虑 wget 再执行写成多行的情况; 就还是可以处理的.
具体实践
对于 bash <( curl xxx.sh) 或 bash <( wget -O- xxx.sh) 的情况
// 正则表达式regex1 = /(bash.*?)(https?:\/\/.*?)(\).*)/s;
// 只处理一层Github 脚本
// 替换表达式replacement2 = '$1' + ghproxy + '$2' + ' | perl -pe "s#(http.*?git[^/]*?/)#' + ghproxy + '\\1#g"' + '$3';
// 处理后的结果resultStr2 = inputStr.replace(regex1, replacement2);
对于 wget xxx.sh && bash xxx.sh 或 wget xxx.sh && chmod +x xxx.sh && ./xxx.sh 的情况
// 正则表达式regex2 = /(wget.*?)(https?:\/\/.*)(&&[^&]*[ /])(.*?sh)/s;// 只处理一层Github 脚本 // 替换表达式replacement3 = '$1' + ghproxy + '$2' + '&& perl -i -pe "s#(http.*?git[^/]*?/)#' + ghproxy + '\\1#g" ' + '$4 $3$4';// 处理后的结果resultStr2 = inputStr.replace(regex2, replacement3);
========
完
更新到
欢迎试用:
https://ghproxy.crazypeace.workers.dev/
https://ghproxy.agrayman.gay/ (这个是
https://ghproxy.crazypeace.repl.co/
https://ghproxy--crazypeace.repl.co/
========
update
如果在 Replit 上跑, 然后又用
评论
发表评论