From d7964a63743113b8e95ee1b6b5d520cfb8e902ac Mon Sep 17 00:00:00 2001 From: jingrow Date: Sun, 10 Aug 2025 17:49:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0uninstall=5Fjsite.sh=E4=B8=80?= =?UTF-8?q?=E9=94=AE=E5=8D=B8=E8=BD=BD=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uninstall_jsite.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 uninstall_jsite.sh diff --git a/uninstall_jsite.sh b/uninstall_jsite.sh new file mode 100644 index 0000000..4d0f3ab --- /dev/null +++ b/uninstall_jsite.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +echo "开始卸载jsite运行环境..." + +# 停止所有PM2进程 +su - jingrow -c "pm2 delete all 2>/dev/null || true" +su - jingrow -c "pm2 unstartup 2>/dev/null || true" + +# 停止traefik +cd /home/jingrow/traefik-docker 2>/dev/null && docker compose down 2>/dev/null || true + +# 卸载PM2 +su - jingrow -c "npm uninstall -g pm2 2>/dev/null || true" + +# 卸载Node.js和NVM +su - jingrow -c "nvm uninstall $NODE_VERSION 2>/dev/null || true" +rm -rf /home/jingrow/.nvm + +# 卸载Docker +apt-get remove -y docker-ce docker-ce-cli containerd.io docker-compose-plugin +apt-get autoremove -y + +# 删除所有目录 +rm -rf /home/jingrow/jsite +rm -rf /home/jingrow/traefik-docker + +# 删除用户 +userdel -r jingrow 2>/dev/null || true + +echo "jsite运行环境卸载完成!" \ No newline at end of file