From 5ea3f46ba3b64c4fc18dc77dfab43a6455d4133b Mon Sep 17 00:00:00 2001 From: lsy Date: Fri, 22 Nov 2024 20:44:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0readme=EF=BC=8C=E5=8D=B8?= =?UTF-8?q?=E8=BD=BD=E8=84=9A=E6=9C=AC=E5=85=B3=E9=97=AD=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E5=91=BD=E4=BB=A4=E7=9A=84=E5=88=AB=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config/Manage/install.sh | 2 +- Config/Manage/unInstall.sh | 3 +++ README.md | 12 +++++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Config/Manage/install.sh b/Config/Manage/install.sh index 6cb4718..7f80c10 100644 --- a/Config/Manage/install.sh +++ b/Config/Manage/install.sh @@ -73,7 +73,7 @@ update_alias() { shopt -s expand_aliases alias tool="$path/linuxtool/run.sh" -export -f tool 2>/dev/null || true +export -f tool &> /dev/null for file in "${HOME}/.bashrc" "${HOME}/.profile" "${HOME}/.zshrc" "/etc/profile"; do update_alias "$file" diff --git a/Config/Manage/unInstall.sh b/Config/Manage/unInstall.sh index f0d629a..d569a0a 100644 --- a/Config/Manage/unInstall.sh +++ b/Config/Manage/unInstall.sh @@ -15,6 +15,9 @@ for file in "${HOME}/.bashrc" "${HOME}/.profile" "${HOME}/.zshrc" "/etc/profile" remove_alias "$file" done +shopt -u expand_aliases + +unalias tool &> /dev/null echo "脚本已完整卸载,公众号 lsy22 可获取一键安装脚本" diff --git a/README.md b/README.md index 4411177..06a92d3 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,20 @@ ## 💻 安装方法 ### 快速安装 +> GitHub 源 ```bash -wget -O install.sh https://raw.githubusercontent.com/lsy2246/linuxtool/main/install.sh && bash install.sh +bash <(curl -Ls https://raw.githubusercontent.com/lsy2246/linuxtool/refs/heads/master/Config/Manage/install.sh) ``` +> Gitee 源(国内推荐) +```bash +bash <(curl -Ls https://gitee.com/lsy22/linuxtool/raw/master/Config/Manage/install.sh) +``` + +注意: +- 请确保系统已安装 `curl` 工具 +- 需要 root 权限或 sudo 权限执行 +- 如遇到网络问题,建议国内用户使用 Gitee 源 ### 使用说明 1. 运行安装脚本 2. 选择安装位置(默认 /var/script)