diff --git a/README.md b/README.md index 39d3799d..c35d5ea9 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ * * * ## 更新信息 +2024.5.5 menu.sh v3.0.6 / warp-go.sh v1.1.8 Support Alpine edge system; 支持 Alpine edge 系统 + 2024.5.1 menu.sh v3.0.5 Deal with apt library changes for Debian 10 installations of wireguard-tools; 处理 Debian 10 安装 wireguard-tools 的 apt 库变更的问题 2024.4.14 menu.sh v3.0.4 1. Alpine check and update the wget version; 2. Add a message for feedback when connect warp fails; 1. Alpine 检测并更新 wget 版本的; 2. 获取 IP 失败时增加提示信息以便反馈 diff --git a/menu.sh b/menu.sh index 0cb458ef..3d8363af 100644 --- a/menu.sh +++ b/menu.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # 当前脚本版本号 -VERSION='3.0.5' +VERSION='3.0.6' # IP API 服务商 IP_API=("http://ip-api.com/json/" "https://api.ip.sb/geoip" "https://ifconfig.co/json" "https://www.cloudflare.com/cdn-cgi/trace") @@ -13,8 +13,8 @@ export DEBIAN_FRONTEND=noninteractive E[0]="\n Language:\n 1. English (default) \n 2. 简体中文\n" C[0]="${E[0]}" -E[1]="Deal with apt library changes for Debian 10 installations of wireguard-tools." -C[1]="处理 Debian 10 安装 wireguard-tools 的 apt 库变更的问题。" +E[1]="Support Alpine edge system." +C[1]="支持 Alpine edge 系统" E[2]="The script must be run as root, you can enter sudo -i and then download and run again. Feedback: [https://github.com/fscarmen/warp-sh/issues]" C[2]="必须以root方式运行脚本,可以输入 sudo -i 后重新下载运行,问题反馈:[https://github.com/fscarmen/warp-sh/issues]" E[3]="The TUN module is not loaded. You should turn it on in the control panel. Ask the supplier for more help. Feedback: [https://github.com/fscarmen/warp-sh/issues]" @@ -31,8 +31,8 @@ E[8]="All dependencies already exist and do not need to be installed additionall C[8]="所有依赖已存在,不需要额外安装" E[9]="Client cannot be upgraded to a Teams account." C[9]="Client 不能升级为 Teams 账户" -E[10]="WireGuard tools are not installed or the configuration file warp.conf cannot be found, please reinstall." -C[10]="没有安装 WireGuard tools 或者找不到配置文件 warp.conf,请重新安装。" +E[10]="wireguard-tools installation failed, The script is aborted. Feedback: [https://github.com/fscarmen/warp-sh/issues]" +C[10]="wireguard-tools 安装失败,脚本中止,问题反馈:[https://github.com/fscarmen/warp-sh/issues]" E[11]="Maximum \${j} attempts to get WARP IP..." C[11]="后台获取 WARP IP 中,最大尝试\${j}次……" E[12]="Try \${i}" @@ -391,6 +391,8 @@ E[188]="All endpoints of WARP cannot be connected. Ask the supplier for more hel C[188]="WARP 的所有的 endpoint 均不能连通,有可能 UDP 被限制了,可联系供应商了解如何开启,问题反馈:[https://github.com/fscarmen/warp-sh/issues]" E[189]="Cannot detect any IPv4 or IPv6. The script is aborted. Feedback: [https://github.com/fscarmen/warp-sh/issues]" C[189]="检测不到任何 IPv4 或 IPv6。脚本中止,问题反馈:[https://github.com/fscarmen/warp-sh/issues]" +E[190]="The configuration file warp.conf cannot be found, The script is aborted. Feedback: [https://github.com/fscarmen/warp-sh/issues]" +C[190]="找不到配置文件 warp.conf,脚本中止,问题反馈:[https://github.com/fscarmen/warp-sh/issues]" # 自定义字体彩色,read 函数 warning() { echo -e "\033[31m\033[01m$*\033[0m"; } # 红色 @@ -440,7 +442,7 @@ check_root() { # 判断虚拟化 check_virt() { if [ "$1" = Alpine ]; then - VIRT=$(virt-what) + VIRT=$(virt-what | tr '\n' ' ') else [ $(type -p systemd-detect-virt) ] && VIRT=$(systemd-detect-virt) [[ -z "$VIRT" && $(type -p hostnamectl) ]] && VIRT=$(hostnamectl | awk '/Virtualization:/{print $NF}') @@ -471,7 +473,7 @@ check_operating_system() { REGEX=("debian" "ubuntu" "centos|red hat|kernel|alma|rocky" "alpine" "arch linux" "fedora") RELEASE=("Debian" "Ubuntu" "CentOS" "Alpine" "Arch" "Fedora") EXCLUDE=("---") - MAJOR=("9" "16" "7" "3" "" "37") + MAJOR=("9" "16" "7" "" "" "37") PACKAGE_UPDATE=("apt -y update" "apt -y update" "yum -y update" "apk update -f" "pacman -Sy" "dnf -y update") PACKAGE_INSTALL=("apt -y install" "apt -y install" "yum -y install" "apk add -f" "pacman -S --noconfirm" "dnf -y install") PACKAGE_UNINSTALL=("apt -y autoremove" "apt -y autoremove" "yum -y autoremove" "apk del -f" "pacman -Rcnsu --noconfirm" "dnf -y autoremove") @@ -1178,7 +1180,8 @@ ver() { net() { local NO_OUTPUT="$1" unset IP4 IP6 WAN4 WAN6 COUNTRY4 COUNTRY6 ASNORG4 ASNORG6 WARPSTATUS4 WARPSTATUS6 TYPE QUOTA - [[ ! $(type -p wg-quick) || ! -e /etc/wireguard/warp.conf ]] && error " $(text 10) " + [ ! $(type -p wg-quick) ] && error " $(text 10) " + [ ! -e /etc/wireguard/warp.conf ] && error " $(text 190) " local i=1; local j=5 hint " $(text 11)\n $(text 12) " [ "$SYSTEM" != Alpine ] && [[ $(systemctl is-active wg-quick@warp) != 'active' ]] && wg-quick down warp >/dev/null 2>&1 @@ -2065,7 +2068,6 @@ EOF if [ "$DEBIAN_VERSION" = '9' ]; then echo "deb http://deb.debian.org/debian/ unstable main" > /etc/apt/sources.list.d/unstable-wireguard.list echo -e "Package: *\nPin: release a=unstable\nPin-Priority: 150\n" > /etc/apt/preferences.d/limit-unstable - elif [ "$DEBIAN_VERSION" = '10' ]; then echo 'deb http://archive.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list diff --git a/warp-go.sh b/warp-go.sh index b74d44ef..e2168e75 100644 --- a/warp-go.sh +++ b/warp-go.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # 当前脚本版本号和新增功能 -VERSION='1.1.7' +VERSION='1.1.8' # IP API 服务商 IP_API=("http://ip-api.com/json/" "https://api.ip.sb/geoip" "https://ifconfig.co/json" "https://www.cloudflare.com/cdn-cgi/trace") @@ -18,8 +18,8 @@ trap "rm -f /tmp/warp-go*; exit 1" INT E[0]="Language:\n 1.English (default) \n 2.简体中文" C[0]="${E[0]}" -E[1]="Remove the github cdn" -C[1]="去掉 Github cdn" +E[1]="Support Alpine edge system." +C[1]="支持 Alpine edge 系统" E[2]="warp-go h (help)\n warp-go o (temporary warp-go switch)\n warp-go u (uninstall WARP web interface and warp-go)\n warp-go v (sync script to latest version)\n warp-go i (replace IP with Netflix support)\n warp-go 4/6 ( WARP IPv4/IPv6 single-stack)\n warp-go d (WARP dual-stack)\n warp-go n (WARP IPv4 non-global)\n warp-go g (WARP global/non-global switching)\n warp-go e (output wireguard and sing-box configuration file)\n warp-go a (Change to Free, WARP+ or Teams account)" C[2]="warp-go h (帮助)\n warp-go o (临时 warp-go 开关)\n warp-go u (卸载 WARP 网络接口和 warp-go)\n warp-go v (同步脚本至最新版本)\n warp-go i (更换支持 Netflix 的IP)\n warp-go 4/6 (WARP IPv4/IPv6 单栈)\n warp-go d (WARP 双栈)\n warp-go n (WARP IPv4 非全局)\n warp-go g (WARP 全局 / 非全局相互切换)\n warp-go e (输出 wireguard 和 sing-box 配置文件)\n warp-go a (更换到 Free,WARP+ 或 Teams 账户)" E[3]="This project is designed to add WARP network interface for VPS, using warp-go core, using various interfaces of CloudFlare-WARP, integrated wireguard-go, can completely replace WGCF. Save Hong Kong, Toronto and other VPS, can also get WARP IP. Thanks again @CoiaPrant and his team. Project address: https://gitlab.com/ProjectWARP/warp-go/-/tree/master/" @@ -315,8 +315,8 @@ check_operating_system() { REGEX=("debian" "ubuntu" "centos|red hat|kernel|alma|rocky|amazon linux" "alpine" "arch linux" "openwrt") RELEASE=("Debian" "Ubuntu" "CentOS" "Alpine" "Arch" "OpenWrt") - EXCLUDE=("") - MAJOR=("9" "16" "7" "3" "" "") + EXCLUDE=("---") + MAJOR=("9" "16" "7" "" "" "") PACKAGE_UPDATE=("apt -y update" "apt -y update" "yum -y update" "apk update -f" "pacman -Sy" "opkg update") PACKAGE_INSTALL=("apt -y install" "apt -y install" "yum -y install" "apk add -f" "pacman -S --noconfirm" "opkg install") PACKAGE_UNINSTALL=("apt -y autoremove" "apt -y autoremove" "yum -y autoremove" "apk del -f" "pacman -Rcnsu --noconfirm" "opkg remove --force-depends")