BBRv3 一键安装脚本国内加速执行方式
在国内服务器上执行 GitHub Raw 脚本时,可能会遇到访问慢、连接失败、下载中断等问题。下面整理几种执行方式:原始指令、GitHub 代理快速执行指令,以及对脚本内部下载地址进行替换的完整加速方式。
原始指令
bash <(curl -fsSL https://raw.githubusercontent.com/byJoey/Actions-bbr-v3/main/install.sh)
GitHub 代理快速执行指令
如果只是 raw.githubusercontent.com 访问不稳定,可以直接通过 gh-proxy.com 代理执行:
bash <(curl -fsSL "https://gh-proxy.com/https://raw.githubusercontent.com/byJoey/Actions-bbr-v3/main/install.sh")
这种方式会通过代理下载入口安装脚本,适合 GitHub Raw 地址访问失败或速度较慢的情况。
国内加速完整替代方式
如果入口脚本能下载,但安装过程中后续 GitHub API 或 Release 文件下载失败,可以使用下面这套完整指令。
这套方式会先下载脚本到本地,然后替换脚本内部的 GitHub API 和 Release 下载地址,让后续安装过程也走 gh-proxy.com 代理。
curl -fsSL "https://gh-proxy.com/https://raw.githubusercontent.com/byJoey/Actions-bbr-v3/main/install.sh" -o install.sh
sed -i 's#https://api.github.com/repos/byJoey/Actions-bbr-v3/releases#https://gh-proxy.com/https://api.github.com/repos/byJoey/Actions-bbr-v3/releases#g' install.sh
sed -i 's#wget -q --show-progress "$URL" -P /tmp/#wget -q --show-progress "https://gh-proxy.com/$URL" -P /tmp/#g' install.sh
bash install.sh
三种方式怎么选
如果服务器访问 GitHub 正常,可以使用原始指令:
bash <(curl -fsSL https://raw.githubusercontent.com/byJoey/Actions-bbr-v3/main/install.sh)
如果只是 GitHub Raw 访问慢,可以使用代理快速执行指令:
bash <(curl -fsSL "https://gh-proxy.com/https://raw.githubusercontent.com/byJoey/Actions-bbr-v3/main/install.sh")
如果安装过程中内核包下载失败,建议使用完整替代方式:
curl -fsSL "https://gh-proxy.com/https://raw.githubusercontent.com/byJoey/Actions-bbr-v3/main/install.sh" -o install.sh
sed -i 's#https://api.github.com/repos/byJoey/Actions-bbr-v3/releases#https://gh-proxy.com/https://api.github.com/repos/byJoey/Actions-bbr-v3/releases#g' install.sh
sed -i 's#wget -q --show-progress "$URL" -P /tmp/#wget -q --show-progress "https://gh-proxy.com/$URL" -P /tmp/#g' install.sh
bash install.sh
说明
原始指令会直接从 GitHub Raw 下载并执行安装脚本:
https://raw.githubusercontent.com/byJoey/Actions-bbr-v3/main/install.sh
代理快速执行方式会把入口脚本地址替换为:
https://gh-proxy.com/https://raw.githubusercontent.com/byJoey/Actions-bbr-v3/main/install.sh
完整替代方式不仅代理入口脚本,还会修改脚本内部访问 GitHub API 和 Release 下载文件的地址,减少因为 GitHub 访问不稳定导致的安装失败。