From d179f13c999a6f63a15dd60fbc8f4b21a5b0e849 Mon Sep 17 00:00:00 2001 From: lsy Date: Thu, 26 Sep 2024 16:40:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config/Manage/unInstall.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Config/Manage/unInstall.sh diff --git a/Config/Manage/unInstall.sh b/Config/Manage/unInstall.sh new file mode 100644 index 0000000..6a0b19b --- /dev/null +++ b/Config/Manage/unInstall.sh @@ -0,0 +1,21 @@ +#!/bin/bash +declare path=$(cat /etc/profile | grep "tool=" | awk -F "=" '{print $2}' | tr -d "'") +path=$(dirname $path) +rm -rf $path +if [[ -e "${HOME}/.bashrc" ]];then + sed -i '/alias tool.*/d' "${HOME}/.bashrc" + source "${HOME}/.bashrc" &> /dev/null +fi + +if [[ -e "${HOME}/.profile" ]];then + sed -i '/alias tool.*/d' "${HOME}/.profile" + source "${HOME}/.profile" &> /dev/null +fi + +if [[ -e "${HOME}/.zshrc" ]];then + sed -i '/alias tool.*/d' "${HOME}/.zshrc" + source "${HOME}/.zshrc" &> /dev/null +fi + +sed -i '/alias tool.*/d' "/etc/profile" +echo "脚本已经卸载完整,公众号 lsy22 可以获取一键安装脚本" \ No newline at end of file