Update t.sh

Former-commit-id: ad6a67757e617c0dad92253b21282d3e658a89b0
This commit is contained in:
fscarmen
2021-06-10 09:41:02 +08:00
committed by GitHub
parent 17924b23e6
commit 2e27dd1c2f
+2 -6
View File
@@ -77,17 +77,13 @@ sudo chmod +x /usr/local/bin/wgcf
echo | wgcf register
until [ $? -eq 0 ]
do
echo -e "\033[32m warp 注册接口繁忙,3秒后重试 \033[0m"
sleep 3
echo | wgcf register
done
# 生成 Wire-Guard 配置文件 (wgcf-profile.conf)
wgcf generate
until [ $? -eq 0 ]
do
wgcf generate
done
# 修改配置文件 wgcf-profile.conf 的内容,使得 IPv6 的流量均被 WireGuard 接管,让 IPv6 的流量通过 WARP IPv4 节点以 NAT 的方式访问外部 IPv6 网络,为了防止当节点发生故障时 DNS 请求无法发出,修改为 IPv4 地址的 DNS
sudo sed -i "7 s/^/PostUp = ip -4 rule add from $(ip a | egrep 'ens|eth0|enp' | awk -F '/' '{print $1}' | awk 'NR==2 {print $2}') lookup main\n/" wgcf-profile.conf && sudo sed -i "8 s/^/PostDown = ip -4 rule delete from $(ip a | egrep 'ens|eth0|enp' | awk -F '/' '{print $1}' | awk 'NR==2 {print $2}') lookup main\n/" wgcf-profile.conf && sudo sed -i 's/engage.cloudflareclient.com/162.159.192.1/g' wgcf-profile.conf && sudo sed -i 's/1.1.1.1/9.9.9.10,8.8.8.8,1.1.1.1/g' wgcf-profile.conf