linuxtool/Config/Manage/unInstall.sh

22 lines
647 B
Bash
Raw Normal View History

2024-09-26 16:40:29 +08:00
#!/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"
2024-09-26 19:31:17 +08:00
echo "脚本已经卸载完整,公众号 lsy22 可以获取一键安装脚本"
2024-09-26 19:49:06 +08:00
kill $PPID &> /dev/null