├── README.md ├── LICENSE └── HY.sh /README.md: -------------------------------------------------------------------------------- 1 | # HY一键脚本工具 2 | 3 | ## 脚本描述 4 | HY一键脚本工具 是一个功能丰富的 Bash 脚本,旨在为 Linux 用户提供便捷的系统管理和自动化操作功能。该脚本设计简洁易用,提供了一系列实用功能,涵盖了系统信息查询、系统更新、系统清理、BBR 内核管理、测试脚本合集、WARP 解锁服务安装、Docker 安装以及幻兽帕鲁服务端管理等。 5 | 6 | ## 功能特点 7 | - **系统信息查询**:通过简单的命令,用户可以快速获取系统关键信息,包括主机名、CPU 信息、内存使用情况、网络状态等,方便了解系统整体状态。 8 | - **系统更新**:提供了自动化系统更新功能,支持在不同发行版下执行适当的更新操作,保持系统安全和稳定。 9 | - **系统清理**:为用户提供了清理系统的功能,自动清理不必要的软件包、日志文件、临时文件等,释放系统资源,提升系统性能。 10 | - **BBR 内核管理**:用户可以方便地安装和配置 BBR 内核,以提升网络传输效率和稳定性,优化网络连接体验。 11 | - **各种测试脚本合集**:整合了多个实用的测试脚本,包括网络速度测试、流媒体解锁测试、TikTok 状态检测等,方便用户评估系统性能和网络环境。 12 | - **WARP 解锁服务安装**:提供了一键安装 WARP 解锁服务的功能,以解锁 ChatGPT、Netflix、Disney+ 等流媒体平台,为用户提供更广泛的娱乐选择。 13 | - **Docker 安装**:支持自动化安装 Docker,提供简单易用的 Docker 环境配置,方便用户进行容器化应用的部署和管理。 14 | - **幻兽帕鲁服务端管理**:为用户提供了一键式安装和管理幻兽帕鲁服务端的功能,用户可以根据需求选择境外或国内机器运行,快速搭建自己的服务端环境。 15 | 16 | ## 脚本特点 17 | - **易用性高**:通过直观的命令行界面,用户可以轻松选择和执行所需的操作,无需繁琐的命令和操作步骤,降低了用户学习成本。 18 | - **兼容性强**:针对不同的 Linux 发行版进行了优化和适配,确保脚本在各种系统环境下的稳定性和可用性,满足用户多样化的需求。 19 | - **稳定可靠**:脚本设计严谨,考虑了不同系统的特点和用户操作习惯,提供了错误处理机制和安全措施,确保脚本的稳定性和可靠性。 20 | 21 | ## 使用方法 22 | ### Debian / Ubuntu 安装下载工具 23 | 如果您使用的是 Debian 或 Ubuntu 系统,请按照以下步骤安装下载工具: 24 | 25 | 1. 执行以下命令更新软件包列表并安装 curl 工具: 26 | ```bash 27 | apt update -y && apt install -y curl 28 | ### CentOS 安装下载工具 29 | 30 | 如果您使用的是 CentOS 系统,请按照以下步骤安装下载工具: 31 | 32 | 1. 执行以下命令更新软件包列表并安装 curl 工具: 33 | ```bash 34 | yum install -y curl 35 | ### 一键脚本 36 | ```bash 37 | curl -sS -O https://raw.githubusercontent.com/d24f1/HY-shell-script/main/HY.sh && chmod +x HY.sh && ./HY.sh 38 | 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /HY.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | while true; do 4 | clear 5 | 6 | echo -e "\033[96m██████╗ ███████╗ ██████╗ ██████╗ ████████╗███████╗" 7 | echo -e "\033[96m██╔══██╗██╔════╝██╔════╝██╔═══██╗╚══██╔══╝██╔════╝" 8 | echo -e "\033[96m██████╔╝█████╗ ██║ ██║ ██║ ██║ ███████╗" 9 | echo -e "\033[96m██╔══██╗██╔══╝ ██║ ██║ ██║ ██║ ╚════██║" 10 | echo -e "\033[96m██████╔╝███████╗╚██████╗╚██████╔╝ ██║ ███████║" 11 | echo -e "\033[96m╚═════╝ ╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚══════╝" 12 | echo -e "\033[0m" 13 | echo -e "\033[1mHY一键脚本工具 v0.4\033[0m" 14 | echo -e "(支持Ubuntu,Debian,Centos系统)\n" 15 | echo -e "\033[4mGitHub项目地址:\033[0m\033[96mhttps://github.com/d24f1/HY-shell-script\033[0m" 16 | echo -e "\033[4mTG官方交流群:\033[0m\033[96mhttps://t.me/hosting_global\033[0m\n" 17 | echo -e "\033[1m------------------------\033[0m" 18 | echo -e "\033[32m1. 系统信息查询" 19 | echo "2. 系统更新" 20 | echo "3. 系统清理" 21 | echo "4. BBR内核管理" 22 | echo "5. 各种测试脚本合集 ▶" 23 | echo "6. 安装WARP解锁ChatGPT Netflix Disney+" 24 | echo "7. Docker管理 ▶" 25 | echo "8. 一键搭建幻兽帕鲁服务端管理 ▶" 26 | echo "9. 甲骨文云脚本合集 ▶" 27 | echo "10. Linux系统重装 ▶" 28 | echo -e "\033[1m------------------------\033[0m" 29 | echo "0. 退出脚本" 30 | echo -e "\033[1m------------------------\033[0m\n" 31 | read -p "请输入你的选择: " choice 32 | 33 | case $choice in 34 | 1) 35 | clear 36 | 37 | # 函数: 获取IPv4地址 38 | get_ipv4_address() { 39 | ipv4_address=$(curl -s https://ipinfo.io/ip) 40 | } 41 | 42 | # 函数: 获取IPv6地址 43 | get_ipv6_address() { 44 | ipv6_address=$(curl -s https://ifconfig.co/) 45 | } 46 | 47 | # 函数: 获取系统信息 48 | get_system_info() { 49 | # 尝试使用 lsb_release 获取系统信息 50 | if command -v lsb_release >/dev/null 2>&1; then 51 | os_info=$(lsb_release -ds 2>/dev/null) 52 | else 53 | # 如果 lsb_release 命令失败,则尝试其他方法 54 | if [ -f "/etc/os-release" ]; then 55 | os_info=$(source /etc/os-release && echo "$PRETTY_NAME") 56 | elif [ -f "/etc/debian_version" ]; then 57 | os_info="Debian $(cat /etc/debian_version)" 58 | elif [ -f "/etc/redhat-release" ]; then 59 | os_info=$(cat /etc/redhat-release) 60 | else 61 | os_info="Unknown" 62 | fi 63 | fi 64 | } 65 | 66 | # 函数: 获取CPU型号 67 | get_cpu_model() { 68 | cpu_info=$(cat /proc/cpuinfo | grep "model name" | uniq | awk -F': ' '{print $2}' | sed 's/^[ \t]*//') 69 | if [ -z "$cpu_info" ]; then 70 | cpu_info="Unknown" 71 | fi 72 | } 73 | 74 | # 函数: 获取CPU占用率 75 | get_cpu_usage() { 76 | if [ -f /proc/stat ]; then 77 | cpu_info=(`cat /proc/stat | grep '^cpu '`) 78 | total_cpu_usage=0 79 | for (( i=1; i<${#cpu_info[@]}; i++ )); do 80 | total_cpu_usage=$((total_cpu_usage + ${cpu_info[$i]})) 81 | done 82 | idle_cpu_usage=${cpu_info[4]} 83 | cpu_usage_percent=$((100 - ((100 * idle_cpu_usage) / total_cpu_usage))) 84 | else 85 | cpu_usage_percent="Unknown" 86 | fi 87 | } 88 | 89 | # 获取IPv4地址 90 | get_ipv4_address 91 | 92 | # 获取IPv6地址 93 | get_ipv6_address 94 | 95 | # 获取系统信息 96 | get_system_info 97 | 98 | # 获取CPU型号 99 | get_cpu_model 100 | 101 | # 获取CPU占用率 102 | get_cpu_usage 103 | 104 | cpu_cores=$(nproc) 105 | mem_info=$(free -b | awk 'NR==2{printf "%.2f/%.2f MB (%.2f%%)", $3/1024/1024, $2/1024/1024, $3*100/$2}') 106 | disk_info=$(df -h | awk '$NF=="/"{printf "%s/%s (%s)", $3, $2, $5}') 107 | country=$(curl -s ipinfo.io/country) 108 | city=$(curl -s ipinfo.io/city) 109 | isp_info=$(curl -s ipinfo.io/org) 110 | cpu_arch=$(uname -m) 111 | hostname=$(hostname) 112 | kernel_version=$(uname -r) 113 | congestion_algorithm=$(sysctl -n net.ipv4.tcp_congestion_control) 114 | queue_algorithm=$(sysctl -n net.core.default_qdisc) 115 | 116 | output=$(awk 'BEGIN { rx_total = 0; tx_total = 0 } 117 | NR > 2 { rx_total += $2; tx_total += $10 } 118 | END { 119 | rx_units = "Bytes"; 120 | tx_units = "Bytes"; 121 | if (rx_total > 1024) { rx_total /= 1024; rx_units = "KB"; } 122 | if (rx_total > 1024) { rx_total /= 1024; rx_units = "MB"; } 123 | if (rx_total > 1024) { rx_total /= 1024; rx_units = "GB"; } 124 | 125 | if (tx_total > 1024) { tx_total /= 1024; tx_units = "KB"; } 126 | if (tx_total > 1024) { tx_total /= 1024; tx_units = "MB"; } 127 | if (tx_total > 1024) { tx_total /= 1024; tx_units = "GB"; } 128 | 129 | printf("总接收: %.2f %s\n总发送: %.2f %s\n", rx_total, rx_units, tx_total, tx_units); 130 | }' /proc/net/dev) 131 | 132 | current_time=$(date "+%Y-%m-%d %I:%M %p") 133 | 134 | swap_used=$(free -m | awk 'NR==3{print $3}') 135 | swap_total=$(free -m | awk 'NR==3{print $2}') 136 | 137 | if [ "$swap_total" -eq 0 ]; then 138 | swap_percentage=0 139 | else 140 | swap_percentage=$((swap_used * 100 / swap_total)) 141 | fi 142 | 143 | swap_info="${swap_used}MB/${swap_total}MB (${swap_percentage}%)" 144 | 145 | runtime=$(cat /proc/uptime | awk -F. '{run_days=int($1 / 86400);run_hours=int(($1 % 86400) / 3600);run_minutes=int(($1 % 3600) / 60); if (run_days > 0) printf("%d天 ", run_days); if (run_hours > 0) printf("%d时 ", run_hours); printf("%d分\n", run_minutes)}') 146 | 147 | echo "" 148 | echo "系统信息查询" 149 | echo "------------------------" 150 | echo "主机名: $hostname" 151 | echo "运营商: $isp_info" 152 | echo "------------------------" 153 | echo "系统版本: $os_info" 154 | echo "Linux版本: $kernel_version" 155 | echo "------------------------" 156 | echo "CPU架构: $cpu_arch" 157 | echo "CPU型号: $cpu_info" 158 | echo "CPU核心数: $cpu_cores" 159 | echo "------------------------" 160 | echo "CPU占用: $cpu_usage_percent%" 161 | echo "物理内存: $mem_info" 162 | echo "虚拟内存: $swap_info" 163 | echo "硬盘占用: $disk_info" 164 | echo "------------------------" 165 | echo "$output" 166 | echo "------------------------" 167 | echo "网络拥堵算法: $congestion_algorithm $queue_algorithm" 168 | echo "------------------------" 169 | echo "公网IPv4地址: $ipv4_address" 170 | echo "公网IPv6地址: $ipv6_address" # 显示IPv6地址 171 | echo "------------------------" 172 | echo "地理位置: $country $city" 173 | echo "系统时间: $current_time" 174 | echo "------------------------" 175 | echo "系统运行时长: $runtime" 176 | echo 177 | 178 | # 添加等待用户输入以确认是否退出 179 | read -p "按任意键退出..." 180 | ;; 181 | 182 | 2) 183 | clear 184 | 185 | clear 186 | 187 | # 函数: 更新Debian系系统 188 | update_debian() { 189 | if [ -f "/etc/debian_version" ]; then 190 | apt update -y && DEBIAN_FRONTEND=noninteractive apt full-upgrade -y 191 | fi 192 | } 193 | 194 | # 函数: 更新CentOS系系统 195 | update_centos() { 196 | if [ -f "/etc/redhat-release" ]; then 197 | yum -y update 198 | fi 199 | } 200 | 201 | # 函数: 更新Ubuntu系统 202 | update_ubuntu() { 203 | if [ -f "/etc/os-release" ]; then 204 | source /etc/os-release 205 | if [[ $ID == "ubuntu" ]]; then 206 | apt update -y && DEBIAN_FRONTEND=noninteractive apt full-upgrade -y 207 | fi 208 | fi 209 | } 210 | 211 | # 更新系统 212 | update_debian 213 | update_centos 214 | update_ubuntu 215 | 216 | # 退出前等待用户按下任意键 217 | read -n 1 -s -r -p "更新已完成。按任意键返回菜单..." 218 | ;; 219 | 220 | 3) 221 | clear 222 | # 函数: 清理Debian系统 223 | clean_debian() { 224 | apt autoremove --purge -y 225 | apt clean -y 226 | apt autoclean -y 227 | apt remove --purge $(dpkg -l | awk '/^rc/ {print $2}') -y 228 | journalctl --rotate 229 | journalctl --vacuum-time=1s 230 | journalctl --vacuum-size=50M 231 | apt remove --purge $(dpkg -l | awk '/^ii linux-(image|headers)-[^ ]+/{print $2}' | grep -v $(uname -r | sed 's/-.*//') | xargs) -y 232 | } 233 | 234 | # 函数: 清理CentOS系统 235 | clean_centos() { 236 | yum autoremove -y 237 | yum clean all 238 | journalctl --rotate 239 | journalctl --vacuum-time=1s 240 | journalctl --vacuum-size=50M 241 | yum remove $(rpm -q kernel | grep -v $(uname -r)) -y 242 | } 243 | 244 | # 函数: 清理Ubuntu系统 245 | clean_ubuntu() { 246 | apt autoremove --purge -y 247 | apt clean -y 248 | apt autoclean -y 249 | apt remove --purge $(dpkg -l | awk '/^rc/ {print $2}') -y 250 | journalctl --rotate 251 | journalctl --vacuum-time=1s 252 | journalctl --vacuum-size=50M 253 | apt remove --purge $(dpkg -l | awk '/^ii linux-(image|headers)-[^ ]+/{print $2}' | grep -v $(uname -r | sed 's/-.*//') | xargs) -y 254 | } 255 | 256 | # 清理系统 257 | if [ -f "/etc/debian_version" ]; then 258 | # Debian系统 259 | clean_debian 260 | elif [ -f "/etc/redhat-release" ]; then 261 | # CentOS系统 262 | clean_centos 263 | elif [ -f "/etc/os-release" ]; then 264 | source /etc/os-release 265 | if [[ $ID == "ubuntu" ]]; then 266 | # Ubuntu系统 267 | clean_ubuntu 268 | fi 269 | fi 270 | 271 | # 退出前等待用户按下任意键 272 | read -n 1 -s -r -p "清理已完成。按任意键返回菜单..." 273 | ;; 274 | 4) 275 | clear 276 | # 安装 wget(如果需要) 277 | if ! command -v wget &>/dev/null; then 278 | if command -v apt &>/dev/null; then 279 | apt update -y && apt install -y wget 280 | elif command -v yum &>/dev/null; then 281 | yum -y update && yum -y install wget 282 | else 283 | echo "未知的包管理器!" 284 | exit 1 285 | fi 286 | fi 287 | wget --no-check-certificate -O tcpx.sh https://raw.githubusercontent.com/ylx2016/Linux-NetSpeed/master/tcpx.sh 288 | chmod +x tcpx.sh 289 | ./tcpx.sh 290 | ;; 291 | 292 | 5) 293 | while true; do 294 | echo " ▼ " 295 | echo "测试脚本合集" 296 | echo "------------------------" 297 | echo "1. ChatGPT解锁状态检测" 298 | echo "2. 流媒体解锁测试" 299 | echo "3. TikTok状态检测" 300 | echo "4. 三网回程延迟路由测试" 301 | echo "5. 三网回程线路测试" 302 | echo "6. 三网专项测速" 303 | echo "7. 全球测速" 304 | echo "8. 亚洲测速" 305 | echo "9. VPS性能专项测试" 306 | echo "10. VPS性能全局测试" 307 | echo "11. 融合怪测评脚本" 308 | echo "------------------------" 309 | echo "0. 返回主菜单" 310 | echo "------------------------" 311 | read -p "请输入你的选择: " sub_choice 312 | 313 | case $sub_choice in 314 | 1) 315 | clear 316 | bash <(curl -Ls https://cdn.jsdelivr.net/gh/missuo/OpenAI-Checker/openai.sh) 317 | ;; 318 | 2) 319 | clear 320 | bash <(curl -L -s media.ispvps.com) 321 | ;; 322 | 3) 323 | clear 324 | wget -qO- https://github.com/yeahwu/check/raw/main/check.sh | bash 325 | ;; 326 | 4) 327 | clear 328 | wget -qO- git.io/besttrace | bash 329 | ;; 330 | 5) 331 | clear 332 | curl https://raw.githubusercontent.com/zhanghanyun/backtrace/main/install.sh -sSf | sh 333 | ;; 334 | 6) 335 | clear 336 | bash <(curl -Lso- https://bench.im/hyperspeed) 337 | ;; 338 | 7) 339 | clear 340 | curl -sL network-speed.xyz | bash 341 | ;; 342 | 8) 343 | clear 344 | curl -sL network-speed.xyz | bash -s -- -r asia 345 | ;; 346 | 9) 347 | clear 348 | curl -sL yabs.sh | bash -s -- -i -5 349 | ;; 350 | 10) 351 | clear 352 | wget -qO- bench.sh | bash 353 | ;; 354 | 11) 355 | clear 356 | curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh 357 | ;; 358 | 0) 359 | break 360 | ;; 361 | *) 362 | echo "无效的输入!" 363 | ;; 364 | esac 365 | echo -e "\033[0;32m操作完成\033[0m" 366 | echo "按任意键继续..." 367 | read -n 1 -s -r -p "" 368 | echo "" 369 | clear 370 | done 371 | ;; 372 | 373 | 6) 374 | clear 375 | # 安装 wget(如果需要) 376 | if ! command -v wget &>/dev/null; then 377 | if command -v apt &>/dev/null; then 378 | apt update -y && apt install -y wget 379 | elif command -v yum &>/dev/null; then 380 | yum -y update && yum -y install wget 381 | else 382 | echo "未知的包管理器!" 383 | exit 1 384 | fi 385 | fi 386 | wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh && bash menu.sh [option] [lisence/url/token] 387 | ;; 388 | 389 | 7) 390 | while true; do 391 | clear 392 | echo "▶ Docker管理器" 393 | echo "------------------------" 394 | echo "1. 安装更新Docker环境" 395 | echo "------------------------" 396 | echo "2. 查看Dcoker全局状态" 397 | echo "------------------------" 398 | echo "3. Dcoker容器管理 ▶" 399 | echo "4. Dcoker镜像管理 ▶" 400 | echo "5. Dcoker网络管理 ▶" 401 | echo "6. Dcoker卷管理 ▶" 402 | echo "------------------------" 403 | echo "7. 清理无用的docker容器和镜像网络数据卷" 404 | echo "------------------------" 405 | echo "8. 卸载Dcoker环境" 406 | echo "------------------------" 407 | echo "0. 返回主菜单" 408 | echo "------------------------" 409 | read -p "请输入你的选择: " sub_choice 410 | 411 | case $sub_choice in 412 | 1) 413 | clear 414 | install_add_docker 415 | 416 | ;; 417 | 2) 418 | clear 419 | echo "Dcoker版本" 420 | docker --version 421 | docker-compose --version 422 | echo "" 423 | echo "Dcoker镜像列表" 424 | docker image ls 425 | echo "" 426 | echo "Dcoker容器列表" 427 | docker ps -a 428 | echo "" 429 | echo "Dcoker卷列表" 430 | docker volume ls 431 | echo "" 432 | echo "Dcoker网络列表" 433 | docker network ls 434 | echo "" 435 | 436 | ;; 437 | 3) 438 | while true; do 439 | clear 440 | echo "Docker容器列表" 441 | docker ps -a 442 | echo "" 443 | echo "容器操作" 444 | echo "------------------------" 445 | echo "1. 创建新的容器" 446 | echo "------------------------" 447 | echo "2. 启动指定容器 6. 启动所有容器" 448 | echo "3. 停止指定容器 7. 暂停所有容器" 449 | echo "4. 删除指定容器 8. 删除所有容器" 450 | echo "5. 重启指定容器 9. 重启所有容器" 451 | echo "------------------------" 452 | echo "11. 进入指定容器 12. 查看容器日志 13. 查看容器网络" 453 | echo "------------------------" 454 | echo "0. 返回上一级选单" 455 | echo "------------------------" 456 | read -p "请输入你的选择: " sub_choice 457 | 458 | case $sub_choice in 459 | 1) 460 | read -p "请输入创建命令: " dockername 461 | $dockername 462 | ;; 463 | 464 | 2) 465 | read -p "请输入容器名: " dockername 466 | docker start $dockername 467 | ;; 468 | 3) 469 | read -p "请输入容器名: " dockername 470 | docker stop $dockername 471 | ;; 472 | 4) 473 | read -p "请输入容器名: " dockername 474 | docker rm -f $dockername 475 | ;; 476 | 5) 477 | read -p "请输入容器名: " dockername 478 | docker restart $dockername 479 | ;; 480 | 6) 481 | docker start $(docker ps -a -q) 482 | ;; 483 | 7) 484 | docker stop $(docker ps -q) 485 | ;; 486 | 8) 487 | read -p "确定删除所有容器吗?(Y/N): " choice 488 | case "$choice" in 489 | [Yy]) 490 | docker rm -f $(docker ps -a -q) 491 | ;; 492 | [Nn]) 493 | ;; 494 | *) 495 | echo "无效的选择,请输入 Y 或 N。" 496 | ;; 497 | esac 498 | ;; 499 | 9) 500 | docker restart $(docker ps -q) 501 | ;; 502 | 11) 503 | read -p "请输入容器名: " dockername 504 | docker exec -it $dockername /bin/bash 505 | break_end 506 | ;; 507 | 12) 508 | read -p "请输入容器名: " dockername 509 | docker logs $dockername 510 | break_end 511 | ;; 512 | 13) 513 | echo "" 514 | container_ids=$(docker ps -q) 515 | 516 | echo "------------------------------------------------------------" 517 | printf "%-25s %-25s %-25s\n" "容器名称" "网络名称" "IP地址" 518 | 519 | for container_id in $container_ids; do 520 | container_info=$(docker inspect --format '{{ .Name }}{{ range $network, $config := .NetworkSettings.Networks }} {{ $network }} {{ $config.IPAddress }}{{ end }}' "$container_id") 521 | 522 | container_name=$(echo "$container_info" | awk '{print $1}') 523 | network_info=$(echo "$container_info" | cut -d' ' -f2-) 524 | 525 | while IFS= read -r line; do 526 | network_name=$(echo "$line" | awk '{print $1}') 527 | ip_address=$(echo "$line" | awk '{print $2}') 528 | 529 | printf "%-20s %-20s %-15s\n" "$container_name" "$network_name" "$ip_address" 530 | done <<< "$network_info" 531 | done 532 | 533 | break_end 534 | ;; 535 | 536 | 0) 537 | break # 跳出循环,退出菜单 538 | ;; 539 | 540 | *) 541 | break # 跳出循环,退出菜单 542 | ;; 543 | esac 544 | done 545 | ;; 546 | 4) 547 | while true; do 548 | clear 549 | echo "Docker镜像列表" 550 | docker image ls 551 | echo "" 552 | echo "镜像操作" 553 | echo "------------------------" 554 | echo "1. 获取指定镜像 3. 删除指定镜像" 555 | echo "2. 更新指定镜像 4. 删除所有镜像" 556 | echo "------------------------" 557 | echo "0. 返回上一级选单" 558 | echo "------------------------" 559 | read -p "请输入你的选择: " sub_choice 560 | 561 | case $sub_choice in 562 | 1) 563 | read -p "请输入镜像名: " dockername 564 | docker pull $dockername 565 | ;; 566 | 2) 567 | read -p "请输入镜像名: " dockername 568 | docker pull $dockername 569 | ;; 570 | 3) 571 | read -p "请输入镜像名: " dockername 572 | docker rmi -f $dockername 573 | ;; 574 | 4) 575 | read -p "确定删除所有镜像吗?(Y/N): " choice 576 | case "$choice" in 577 | [Yy]) 578 | docker rmi -f $(docker images -q) 579 | ;; 580 | [Nn]) 581 | 582 | ;; 583 | *) 584 | echo "无效的选择,请输入 Y 或 N。" 585 | ;; 586 | esac 587 | ;; 588 | 0) 589 | break # 跳出循环,退出菜单 590 | ;; 591 | 592 | *) 593 | break # 跳出循环,退出菜单 594 | ;; 595 | esac 596 | done 597 | ;; 598 | 599 | 5) 600 | while true; do 601 | clear 602 | echo "Docker网络列表" 603 | echo "------------------------------------------------------------" 604 | docker network ls 605 | echo "" 606 | 607 | echo "------------------------------------------------------------" 608 | container_ids=$(docker ps -q) 609 | printf "%-25s %-25s %-25s\n" "容器名称" "网络名称" "IP地址" 610 | 611 | for container_id in $container_ids; do 612 | container_info=$(docker inspect --format '{{ .Name }}{{ range $network, $config := .NetworkSettings.Networks }} {{ $network }} {{ $config.IPAddress }}{{ end }}' "$container_id") 613 | 614 | container_name=$(echo "$container_info" | awk '{print $1}') 615 | network_info=$(echo "$container_info" | cut -d' ' -f2-) 616 | 617 | while IFS= read -r line; do 618 | network_name=$(echo "$line" | awk '{print $1}') 619 | ip_address=$(echo "$line" | awk '{print $2}') 620 | 621 | printf "%-20s %-20s %-15s\n" "$container_name" "$network_name" "$ip_address" 622 | done <<< "$network_info" 623 | done 624 | 625 | echo "" 626 | echo "网络操作" 627 | echo "------------------------" 628 | echo "1. 创建网络" 629 | echo "2. 加入网络" 630 | echo "3. 退出网络" 631 | echo "4. 删除网络" 632 | echo "------------------------" 633 | echo "0. 返回上一级选单" 634 | echo "------------------------" 635 | read -p "请输入你的选择: " sub_choice 636 | 637 | case $sub_choice in 638 | 1) 639 | read -p "设置新网络名: " dockernetwork 640 | docker network create $dockernetwork 641 | ;; 642 | 2) 643 | read -p "加入网络名: " dockernetwork 644 | read -p "那些容器加入该网络: " dockername 645 | docker network connect $dockernetwork $dockername 646 | echo "" 647 | ;; 648 | 3) 649 | read -p "退出网络名: " dockernetwork 650 | read -p "那些容器退出该网络: " dockername 651 | docker network disconnect $dockernetwork $dockername 652 | echo "" 653 | ;; 654 | 655 | 4) 656 | read -p "请输入要删除的网络名: " dockernetwork 657 | docker network rm $dockernetwork 658 | ;; 659 | 0) 660 | break # 跳出循环,退出菜单 661 | ;; 662 | 663 | *) 664 | break # 跳出循环,退出菜单 665 | ;; 666 | esac 667 | done 668 | ;; 669 | 670 | 6) 671 | while true; do 672 | clear 673 | echo "Docker卷列表" 674 | docker volume ls 675 | echo "" 676 | echo "卷操作" 677 | echo "------------------------" 678 | echo "1. 创建新卷" 679 | echo "2. 删除卷" 680 | echo "------------------------" 681 | echo "0. 返回上一级选单" 682 | echo "------------------------" 683 | read -p "请输入你的选择: " sub_choice 684 | 685 | case $sub_choice in 686 | 1) 687 | read -p "设置新卷名: " dockerjuan 688 | docker volume create $dockerjuan 689 | 690 | ;; 691 | 2) 692 | read -p "输入删除卷名: " dockerjuan 693 | docker volume rm $dockerjuan 694 | 695 | ;; 696 | 0) 697 | break # 跳出循环,退出菜单 698 | ;; 699 | 700 | *) 701 | break # 跳出循环,退出菜单 702 | ;; 703 | esac 704 | done 705 | ;; 706 | 7) 707 | clear 708 | read -p "确定清理无用的镜像容器网络吗?(Y/N): " choice 709 | case "$choice" in 710 | [Yy]) 711 | docker system prune -af --volumes 712 | ;; 713 | [Nn]) 714 | ;; 715 | *) 716 | echo "无效的选择,请输入 Y 或 N。" 717 | ;; 718 | esac 719 | ;; 720 | 8) 721 | clear 722 | read -p "确定卸载docker环境吗?(Y/N): " choice 723 | case "$choice" in 724 | [Yy]) 725 | docker rm $(docker ps -a -q) && docker rmi $(docker images -q) && docker network prune 726 | remove docker docker-ce docker-compose > /dev/null 2>&1 727 | ;; 728 | [Nn]) 729 | ;; 730 | *) 731 | echo "无效的选择,请输入 Y 或 N。" 732 | ;; 733 | esac 734 | ;; 735 | 0) 736 | break 737 | ;; 738 | *) 739 | echo "无效的输入!" 740 | ;; 741 | esac 742 | echo -e "\033[0;32m操作完成\033[0m" 743 | echo "按任意键继续..." 744 | read -n 1 -s -r -p "" 745 | echo "" 746 | clear 747 | done 748 | ;; 749 | 750 | 8) 751 | while true; do 752 | echo " ▼ " 753 | echo "不支持Arm架构,推荐Debian11 12 Ubuntu20.04 22.04系统" 754 | echo "------------------------" 755 | echo "1. 境外机运行一键脚本" 756 | echo "2. 国内机运行一键脚本" 757 | echo "------------------------" 758 | echo "0. 返回主菜单" 759 | echo "------------------------" 760 | read -p "请输入你的选择: " sub_choice 761 | 762 | case $sub_choice in 763 | 1) 764 | clear 765 | curl -o palinstall.sh https://raw.githubusercontent.com/miaowmint/palworld/main/install.sh && chmod +x palinstall.sh && bash palinstall.sh 766 | ;; 767 | 2) 768 | clear 769 | curl -o palinstall.sh https://blog.iloli.love/install.sh && chmod +x palinstall.sh && bash palinstall.sh 770 | ;; 771 | 0) 772 | break 773 | ;; 774 | *) 775 | echo "无效的输入!" 776 | ;; 777 | esac 778 | echo -e "\033[0;32m操作完成\033[0m" 779 | echo "按任意键继续..." 780 | read -n 1 -s -r -p "" 781 | echo "" 782 | clear 783 | done 784 | ;; 785 | 786 | 9) 787 | while true; do 788 | clear 789 | echo "▶ 甲骨文云脚本合集" 790 | echo "------------------------" 791 | echo "1. 安装闲置机器活跃脚本" 792 | echo "2. 卸载闲置机器活跃脚本" 793 | echo "------------------------" 794 | echo "3. DD重装系统脚本" 795 | echo "4. R探长开机脚本" 796 | echo "------------------------" 797 | echo "5. 开启ROOT密码登录模式" 798 | echo "------------------------" 799 | echo "0. 返回主菜单" 800 | echo "------------------------" 801 | read -p "请输入你的选择: " sub_choice 802 | 803 | case $sub_choice in 804 | 1) 805 | clear 806 | echo "活跃脚本: CPU占用10-20% 内存占用15% " 807 | read -p "确定安装吗?(Y/N): " choice 808 | case "$choice" in 809 | [Yy]) 810 | 811 | install_docker 812 | 813 | docker run -itd --name=lookbusy --restart=always \ 814 | -e TZ=Asia/Shanghai \ 815 | -e CPU_UTIL=10-20 \ 816 | -e CPU_CORE=1 \ 817 | -e MEM_UTIL=15 \ 818 | -e SPEEDTEST_INTERVAL=120 \ 819 | fogforest/lookbusy 820 | ;; 821 | [Nn]) 822 | 823 | ;; 824 | *) 825 | echo "无效的选择,请输入 Y 或 N。" 826 | ;; 827 | esac 828 | ;; 829 | 2) 830 | clear 831 | docker rm -f lookbusy 832 | docker rmi fogforest/lookbusy 833 | ;; 834 | 835 | 3) 836 | clear 837 | echo "请备份数据,将为你重装系统,预计花费15分钟。" 838 | read -p "确定继续吗?(Y/N): " choice 839 | 840 | case "$choice" in 841 | [Yy]) 842 | while true; do 843 | read -p "请选择要重装的系统: 1. Debian12 | 2. Ubuntu20.04 : " sys_choice 844 | 845 | case "$sys_choice" in 846 | 1) 847 | xitong="-d 12" 848 | break # 结束循环 849 | ;; 850 | 2) 851 | xitong="-u 20.04" 852 | break # 结束循环 853 | ;; 854 | *) 855 | echo "无效的选择,请重新输入。" 856 | ;; 857 | esac 858 | done 859 | 860 | read -p "请输入你重装后的密码: " vpspasswd 861 | install wget 862 | bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') $xitong -v 64 -p $vpspasswd -port 22 863 | ;; 864 | [Nn]) 865 | echo "已取消" 866 | ;; 867 | *) 868 | echo "无效的选择,请输入 Y 或 N。" 869 | ;; 870 | esac 871 | ;; 872 | 873 | 4) 874 | clear 875 | echo "该功能处于开发阶段,敬请期待!" 876 | ;; 877 | 5) 878 | clear 879 | echo "设置你的ROOT密码" 880 | passwd 881 | sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config; 882 | sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config; 883 | service sshd restart 884 | echo "ROOT登录设置完毕!" 885 | read -p "需要重启服务器吗?(Y/N): " choice 886 | case "$choice" in 887 | [Yy]) 888 | reboot 889 | ;; 890 | [Nn]) 891 | echo "已取消" 892 | ;; 893 | *) 894 | echo "无效的选择,请输入 Y 或 N。" 895 | ;; 896 | esac 897 | ;; 898 | 0) 899 | break 900 | ;; 901 | *) 902 | echo "无效的输入!" 903 | ;; 904 | esac 905 | echo -e "\033[0;32m操作完成\033[0m" 906 | echo "按任意键继续..." 907 | read -n 1 -s -r -p "" 908 | echo "" 909 | clear 910 | done 911 | ;; 912 | 913 | 10) 914 | while true; do 915 | echo " ▼ " 916 | echo "Linux系统重装" 917 | echo "------------------------" 918 | echo "1. KVM价架构机器重装" 919 | echo "2. OpenVZ/LXC架构机器重装" 920 | echo "------------------------" 921 | echo "0. 返回主菜单" 922 | echo "------------------------" 923 | read -p "请输入你的选择: " sub_choice 924 | 925 | case $sub_choice in 926 | 1) 927 | 928 | while true; do 929 | echo " ▼ " 930 | echo "KVM价架构机器重装" 931 | echo "------------------------" 932 | echo "1. 安装Debian 12" 933 | echo "2. 安装CentOS 9 stream" 934 | echo "3. 安装AlmaLinux 9" 935 | echo "4. 安装RockyLinux 9" 936 | echo "5. 安装Fedora 39" 937 | echo "6. Ubuntu 22.04" 938 | echo "------------------------" 939 | echo "0. 返回主菜单" 940 | echo "------------------------" 941 | read -p "请输入你的选择: " sub_choice 942 | 943 | case $sub_choice in 944 | 1) 945 | clear 946 | wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh 947 | bash InstallNET.sh -debian 948 | reboot 949 | ;; 950 | 2) 951 | clear 952 | wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh 953 | bash InstallNET.sh -centos 954 | reboot 955 | ;; 956 | 3) 957 | clear 958 | wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh 959 | bash InstallNET.sh -almalinux 960 | reboot 961 | ;; 962 | 4) 963 | clear 964 | wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh 965 | bash InstallNET.sh -rockylinux 966 | reboot 967 | ;; 968 | 5) 969 | clear 970 | wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh 971 | bash InstallNET.sh -fedora 972 | reboot 973 | ;; 974 | 6) 975 | clear 976 | wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh 977 | bash InstallNET.sh -ubuntu 978 | reboot 979 | ;; 980 | 981 | 0) 982 | break # 跳出循环,退出菜单 983 | ;; 984 | 985 | *) 986 | break # 跳出循环,退出菜单 987 | ;; 988 | esac 989 | done 990 | ;; 991 | 2) 992 | 993 | while true; do 994 | echo " ▼ " 995 | echo "OpenVZ/LXC架构机器重装" 996 | echo "------------------------" 997 | echo "1. 硬盘小于1G重装系统" 998 | echo "2. 硬盘大于1G重装系统" 999 | echo "------------------------" 1000 | echo "0. 返回主菜单" 1001 | echo "------------------------" 1002 | read -p "请输入你的选择: " sub_choice 1003 | 1004 | case $sub_choice in 1005 | 1) 1006 | clear 1007 | wget -qO OsMutation.sh https://raw.githubusercontent.com/LloydAsp/OsMutation/main/OsMutation.sh && chmod u+x OsMutation.sh && ./OsMutation.sh 1008 | ;; 1009 | 2) 1010 | clear 1011 | wget -qO OsMutation.sh https://raw.githubusercontent.com/LloydAsp/OsMutation/main/OsMutationTight.sh && chmod u+x OsMutation.sh && ./OsMutation.sh 1012 | ;; 1013 | 1014 | 0) 1015 | break # 跳出循环,退出菜单 1016 | ;; 1017 | 1018 | *) 1019 | break # 跳出循环,退出菜单 1020 | ;; 1021 | esac 1022 | done 1023 | ;; 1024 | 1025 | 0) 1026 | break 1027 | ;; 1028 | *) 1029 | echo "无效的输入!" 1030 | ;; 1031 | esac 1032 | echo -e "\033[0;32m操作完成\033[0m" 1033 | echo "按任意键继续..." 1034 | read -n 1 -s -r -p "" 1035 | echo "" 1036 | clear 1037 | done 1038 | ;; 1039 | 1040 | 0) 1041 | clear 1042 | echo "感谢您使用我们的脚本。再见!" 1043 | exit 0 1044 | ;; 1045 | *) 1046 | clear 1047 | echo "错误: 无效的选项,请重新输入." 1048 | ;; 1049 | esac 1050 | done 1051 | --------------------------------------------------------------------------------