Update warp.sh

Former-commit-id: 902134349c1c1bbba4a08b1666fc2cd55844d982
This commit is contained in:
fscarmen
2021-09-12 16:20:26 +08:00
committed by GitHub
parent bca2013a92
commit dc75947dcd
+7 -7
View File
@@ -5,7 +5,7 @@
echo -e "\033[32m (1/3) 安装系统依赖和 wireguard 内核模块 \033[0m"
# Debian 运行以下脚本
if grep -q -E -i "debian" /etc/issue; then
if [[ $(hostnamectl | tr A-Z a-z ) =~ debian ]]; then
# 更新源
apt update
@@ -20,8 +20,8 @@ if grep -q -E -i "debian" /etc/issue; then
# 安装一些必要的网络工具包和wireguard-tools (Wire-Guard 配置工具:wg、wg-quick)
apt -y --no-install-recommends install net-tools iproute2 openresolv dnsutils wireguard-tools
# Ubuntu 运行以下脚本
elif grep -q -E -i "ubuntu" /etc/issue; then
# Ubuntu 运行以下脚本
elif [[ $(hostnamectl | tr A-Z a-z ) =~ ubuntu ]]; then
# 更新源
apt update
@@ -29,8 +29,8 @@ if grep -q -E -i "debian" /etc/issue; then
# 安装一些必要的网络工具包和wireguard-tools (Wire-Guard 配置工具:wg、wg-quick)
apt -y --no-install-recommends install net-tools iproute2 openresolv dnsutils wireguard-tools
# CentOS 运行以下脚本
elif grep -q -E -i "kernel" /etc/issue; then
# CentOS 运行以下脚本
elif [[ $(hostnamectl | tr A-Z a-z ) =~ centos ]]; then
# 安装一些必要的网络工具包和wireguard-tools (Wire-Guard 配置工具:wg、wg-quick)
yum -y install net-tools wireguard-tools
@@ -41,7 +41,7 @@ if grep -q -E -i "debian" /etc/issue; then
# 如都不符合,提示,删除临时文件并中止脚本
else
# 提示找不到相应操作系统
echo -e "\033[32m 抱歉,我不认识此系统\033[0m"
echo -e "\033[32m 本脚本只支持 Debian、Ubuntu 和 CentOS 系统 \033[0m"
# 删除临时目录和文件,退出脚本
rm -f warp.sh menu.sh
@@ -91,7 +91,7 @@ cp wgcf-profile.conf /etc/wireguard/wgcf.conf
echo -e "\033[32m (3/3) 运行 WGCF \033[0m"
echo -e "\033[32m 后台获取 warp IP 中,有时候需10分钟,请耐心等待。 \033[0m"
wg-quick up wgcf >/dev/null 2>&1
until [[ -n $(wget -qO- -6 ip.gs) ]]
until [[ -n $(wget -T1 -t1 -qO- -6 ip.gs) ]]
do
wg-quick down wgcf >/dev/null 2>&1
wg-quick up wgcf >/dev/null 2>&1