在受限的VPS环境下 使用233boy的sing-box脚本

在233boy的群里, 总是遇到有人在受限的VPS环境下安装失败.

看了不少失败的案例, 一般是2个原因:
1. 访问github资源失败
2. 检测服务器IP失败


LT; DR

安装命令
bash <(wget -qO- -o- https://ghproxy.lvedong.eu.org/https://github.com/233boy/sing-box/raw/main/install.sh | sed s/one\.one\.one\.one/www\.cloudflare\.com/gi | perl -pe "$(curl -L https://ghproxy.lvedong.eu.org/perl-pe-para)")
维护, 在安装完成之后
find /etc/sing-box/sh -type f -name "*.sh" -exec sed -i 's/one\.one\.one\.one/www.cloudflare.com/gi' {} +
然后像原来一样的使用命令

具体解决过程

访问github资源的问题

用github proxy解决
https://ghproxy.lvedong.eu.org/

检测服务器IP失败的问题

查了一下源码, 
https://github.dev/233boy/sing-box/blob/596efd56597ca63973dd1a0d3d03b13bac356fbc/install.sh#L190-L191
解决方案就是把 one.one.one.one 换成 www.cloudflare.com
可以使用sed命令进行替换.
安装命令变成
bash <(wget -qO- -o- https://github.com/233boy/sing-box/raw/main/install.sh | sed s/one\.one\.one\.one/www\.cloudflare\.com/gi)
维护呢? 查了一下源码,
https://github.dev/233boy/sing-box/blob/596efd56597ca63973dd1a0d3d03b13bac356fbc/src/core.sh#L118
问了一下GPT,
https://poe.com/s/e4f5JCcQ6o0ZwwKxBmFe
在安装完之后, 执行一下
find /etc/sing-box/sh -type f -name "*.sh" -exec sed -i 's/one\.one\.one\.one/www.cloudflare.com/gi' {} +

========

后记

同理可得

233boy的v2ray脚本

安装命令
bash <(wget -qO- -o- https://ghproxy.lvedong.eu.org/https://git.io/v2ray.sh | sed s/one\.one\.one\.one/www\.cloudflare\.com/gi | perl -pe "$(curl -L https://ghproxy.lvedong.eu.org/perl-pe-para)")
维护, 在安装完成之后
find /etc/v2ray/sh -type f -name "*.sh" -exec sed -i 's/one\.one\.one\.one/www.cloudflare.com/gi' {} +

233boy的xray脚本

安装命令

bash <(wget -qO- -o- https://ghproxy.lvedong.eu.org/https://github.com/233boy/Xray/raw/main/install.sh | sed s/one\.one\.one\.one/www\.cloudflare\.com/gi | perl -pe "$(curl -L https://ghproxy.lvedong.eu.org/perl-pe-para)")

维护, 在安装完成之后

find /etc/xray/sh -type f -name "*.sh" -exec sed -i 's/one\.one\.one\.one/www.cloudflare.com/gi' {} +

评论

The Hot3 in Last 30 Days