From cc24c8f77954d4e9e862b7d2cee9fcd4ba309134 Mon Sep 17 00:00:00 2001 From: fscarmen <62703343+fscarmen@users.noreply.github.com> Date: Fri, 18 Mar 2022 22:23:25 +0800 Subject: [PATCH] Update menu.sh --- menu.sh | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/menu.sh b/menu.sh index 65baaeb..05ff89a 100644 --- a/menu.sh +++ b/menu.sh @@ -3,14 +3,14 @@ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin:/b export LANG=en_US.UTF-8 # 当前脚本版本号和新增功能 -VERSION=2.33 +VERSION=2.34 declare -A T T[E0]="\n Language:\n 1.English (default) \n 2.简体中文\n" T[C0]="${T[E0]}" -T[E1]="1. First publication on a global scale. WARP Client support Ubuntu 18.04 and CentOS 7; 2. Open TUN for OVZ. You needn't setting it in the control panel. " -T[C1]="1. 全网首发: WARP Client 支持 Ubuntu 18.04 and CentOS 7; 2. 为 OVZ VPS 在线打开 TUN,不需要到面板处理" +T[E1]="1. First publication on a global scale. WARP Client support Ubuntu 18.04 and CentOS 7; 2. Support Arch Linux. " +T[C1]="1. 全网首发: WARP Client 支持 Ubuntu 18.04 and CentOS 7; 2. 支持 Arch Linux" T[E2]="The script must be run as root, you can enter sudo -i and then download and run again. Feedback: [https://github.com/fscarmen/warp/issues]" T[C2]="必须以root方式运行脚本,可以输入 sudo -i 后重新下载运行,问题反馈:[https://github.com/fscarmen/warp/issues]" T[E3]="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/issues]" @@ -39,8 +39,8 @@ T[E14]="Got the WARP IP successfully." T[C14]="已成功获取 WARP 网络" T[E15]="WARP is turned off. It could be turned on again by [warp o]" T[C15]="已暂停 WARP,再次开启可以用 warp o" -T[E16]="The script specifically adds WARP network interface for VPS, detailed:[https://github.com/fscarmen/warp]\n Features:\n * Support WARP+ account. Third-party scripts are use to increase WARP+ quota or upgrade kernel.\n * Not only menus, but commands with option.\n * Intelligent analysis of operating system:Ubuntu 16.04、18.04、20.04,Debian 10、11,CentOS 7、8, Alpine 3. Be sure to choose the LTS system. And architecture:AMD or ARM\n * Automatically select four WireGuard solutions. Performance: Kernel with WireGuard integration>Install kernel module>wireguard-go\n * Intelligent analysis of the latest version of the WGCF\n * Suppert WARP Linux client.\n * Output WARP status, IP region and asn\n" -T[C16]="本项目专为 VPS 添加 wgcf 网络接口,详细说明:[https://github.com/fscarmen/warp]\n脚本特点:\n * 支持 WARP+ 账户,附带第三方刷 WARP+ 流量和升级内核 BBR 脚本\n * 普通用户友好的菜单,进阶者通过后缀选项快速搭建\n * 智能判断操作系统:Ubuntu 、Debian 、CentOS 和 Alpine,请务必选择 LTS 系统;硬件结构类型:AMD 或者 ARM\n * 结合 Linux 版本和虚拟化方式,自动优选4个 WireGuard 方案。网络性能方面:内核集成 WireGuard>安装内核模块>wireguard-go\n * 智能判断 WGCF 作者 github库的最新版本 (Latest release)\n * 支持 WARP Linux Socks5 Client\n * 输出执行结果,提示是否使用 WARP IP ,IP 归属地和线路提供商\n" +T[E16]="The script specifically adds WARP network interface for VPS, detailed:[https://github.com/fscarmen/warp]\n Features:\n * Support WARP+ account. Third-party scripts are use to increase WARP+ quota or upgrade kernel.\n * Not only menus, but commands with option.\n * Intelligent analysis of operating system:Ubuntu 16.04、18.04、20.04,Debian 10、11,CentOS 7、8, Alpine, Arch Linux 3. Be sure to choose the LTS system. And architecture:AMD or ARM\n * Automatically select four WireGuard solutions. Performance: Kernel with WireGuard integration>Install kernel module>wireguard-go\n * Intelligent analysis of the latest version of the WGCF\n * Suppert WARP Linux client.\n * Output WARP status, IP region and asn\n" +T[C16]="本项目专为 VPS 添加 wgcf 网络接口,详细说明:[https://github.com/fscarmen/warp]\n脚本特点:\n * 支持 WARP+ 账户,附带第三方刷 WARP+ 流量和升级内核 BBR 脚本\n * 普通用户友好的菜单,进阶者通过后缀选项快速搭建\n * 智能判断操作系统:Ubuntu 、Debian 、CentOS、 Alpine 和 Arch Linux,请务必选择 LTS 系统;硬件结构类型:AMD 或者 ARM\n * 结合 Linux 版本和虚拟化方式,自动优选4个 WireGuard 方案。网络性能方面:内核集成 WireGuard>安装内核模块>wireguard-go\n * 智能判断 WGCF 作者 github库的最新版本 (Latest release)\n * 支持 WARP Linux Socks5 Client\n * 输出执行结果,提示是否使用 WARP IP ,IP 归属地和线路提供商\n" T[E17]="Version" T[C17]="脚本版本" T[E18]="New features" @@ -355,17 +355,17 @@ check_operating_system(){ alpine_wgcf_restart(){ wg-quick down wgcf >/dev/null 2>&1; wg-quick up wgcf >/dev/null 2>&1; } alpine_wgcf_enable(){ echo 'nohup wg-quick up wgcf &' > /etc/local.d/wgcf.start; chmod +x /etc/local.d/wgcf.start; rc-update add local; } - REGEX=("debian" "ubuntu" "centos|red hat|kernel|oracle linux|alma|rocky" "'amazon linux'" "alpine") - RELEASE=("Debian" "Ubuntu" "CentOS" "CentOS" "Alpine") + REGEX=("debian" "ubuntu" "centos|red hat|kernel|oracle linux|alma|rocky" "'amazon linux'" "alpine" "arch linux") + RELEASE=("Debian" "Ubuntu" "CentOS" "CentOS" "Alpine" "Arch") EXCLUDE=("bookworm") - COMPANY=("" "" "" "amazon" "") - MAJOR=("10" "16" "7" "7" "3") - PACKAGE_UPDATE=("apt -y update" "apt -y update" "yum -y update" "yum -y update" "apk update -f") - PACKAGE_INSTALL=("apt -y install" "apt -y install" "yum -y install" "yum -y install" "apk add -f") - PACKAGE_UNINSTALL=("apt -y autoremove" "apt -y autoremove" "yum -y autoremove" "yum -y autoremove" "apk del -f") - SYSTEMCTL_START=("systemctl start wg-quick@wgcf" "systemctl start wg-quick@wgcf" "systemctl start wg-quick@wgcf" "systemctl start wg-quick@wgcf" "wg-quick up wgcf") - SYSTEMCTL_RESTART=("systemctl restart wg-quick@wgcf" "systemctl restart wg-quick@wgcf" "systemctl restart wg-quick@wgcf" "systemctl restart wg-quick@wgcf" "alpine_wgcf_restart") - SYSTEMCTL_ENABLE=("systemctl enable --now wg-quick@wgcf" "systemctl enable --now wg-quick@wgcf" "systemctl enable --now wg-quick@wgcf" "systemctl enable --now wg-quick@wgcf" "alpine_wgcf_enable") + COMPANY=("" "" "" "amazon" "" "") + MAJOR=("10" "16" "7" "7" "3" "") + PACKAGE_UPDATE=("apt -y update" "apt -y update" "yum -y update" "yum -y update" "apk update -f" "") + PACKAGE_INSTALL=("apt -y install" "apt -y install" "yum -y install" "yum -y install" "apk add -f" "pacman -S --noconfirm") + PACKAGE_UNINSTALL=("apt -y autoremove" "apt -y autoremove" "yum -y autoremove" "yum -y autoremove" "apk del -f" "pacman -R --noconfirm") + SYSTEMCTL_START=("systemctl start wg-quick@wgcf" "systemctl start wg-quick@wgcf" "systemctl start wg-quick@wgcf" "systemctl start wg-quick@wgcf" "wg-quick up wgcf" "systemctl start wg-quick@wgcf") + SYSTEMCTL_RESTART=("systemctl restart wg-quick@wgcf" "systemctl restart wg-quick@wgcf" "systemctl restart wg-quick@wgcf" "systemctl restart wg-quick@wgcf" "alpine_wgcf_restart" "systemctl restart wg-quick@wgcf") + SYSTEMCTL_ENABLE=("systemctl enable --now wg-quick@wgcf" "systemctl enable --now wg-quick@wgcf" "systemctl enable --now wg-quick@wgcf" "systemctl enable --now wg-quick@wgcf" "alpine_wgcf_enable" "systemctl enable --now wg-quick@wgcf") for ((int=0; int<${#REGEX[@]}; int++)); do [[ $(echo "$SYS" | tr '[:upper:]' '[:lower:]') =~ ${REGEX[int]} ]] && SYSTEM="${RELEASE[int]}" && COMPANY="${COMPANY[int]}" && [[ -n $SYSTEM ]] && break @@ -770,7 +770,7 @@ EOF fi # 判断处理器架构 - case $(tr '[:upper:]' '[:lower:]' <<< "$(arch)") in + case $(uname -m) in aarch64 ) ARCHITECTURE=arm64;; x86_64 ) ARCHITECTURE=amd64;; s390x ) ARCHITECTURE=s390x && S390X='-s390x';; * ) red " $(eval echo "${T[${L}134]}") " && exit 1;; esac @@ -1088,6 +1088,11 @@ install(){ # 安装一些必要的网络工具包和wireguard-tools (Wire-Guard 配置工具:wg、wg-quick) ${PACKAGE_INSTALL[int]} net-tools iproute2 openresolv wireguard-tools openrc iptables } + + Arch(){ + # 安装一些必要的网络工具包和wireguard-tools (Wire-Guard 配置工具:wg、wg-quick) + ${PACKAGE_INSTALL[int]} net-tools iproute2 openresolv wireguard-tools iptables resolvconf + } $SYSTEM