linuxtool/Config/Manage/unInstall.sh

16 lines
411 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
2025-06-06 01:25:11 +08:00
# 删除软链接
if [[ -L "/usr/bin/tool" ]]; then
rm -f "/usr/bin/tool"
fi
2024-09-26 16:40:29 +08:00
2025-06-06 01:25:11 +08:00
# 从环境变量配置中删除工具路径
sed -i '/tool=.*/d' /etc/profile
2024-09-26 16:40:29 +08:00
echo "脚本已完整卸载,公众号 lsy22 可获取一键安装脚本"
2025-06-06 01:25:11 +08:00
kill $PPID &>/dev/null