linuxtool/Config/Manage/unInstall.sh

21 lines
508 B
Bash
Raw Normal View History

2024-09-26 16:40:29 +08:00
#!/bin/bash
declare tool_path=$(cat /etc/profile | grep "tool=" | awk -F "=" '{print $2}' | tr -d "'")
tool_path=$(dirname $tool_path)
rm -rf $tool_path
2024-09-26 16:40:29 +08:00
2024-11-19 00:00:28 +08:00
remove_alias() {
local file="$1"
if [[ -e "$file" ]]; then
sed -i '/alias tool.*/d' "$file"
source "$file" &> /dev/null
fi
}
for file in "${HOME}/.bashrc" "${HOME}/.profile" "${HOME}/.zshrc" "/etc/profile"; do
remove_alias "$file"
done
2024-09-26 16:40:29 +08:00
echo "脚本已完整卸载,公众号 lsy22 可获取一键安装脚本"
2024-09-26 19:49:06 +08:00
kill $PPID &> /dev/null