From 1111e09c6d58a0d89ace3feb4a86324d5b72ea7c Mon Sep 17 00:00:00 2001 From: guofei Date: Tue, 22 Oct 2024 15:36:41 +0800 Subject: [PATCH] feat: add start sh --- .start.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .start.sh diff --git a/.start.sh b/.start.sh new file mode 100644 index 0000000..aa8a93f --- /dev/null +++ b/.start.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# 确保脚本以root权限运行 +if [ "$(id -u)" != "0" ]; then + echo "该脚本必须以root权限运行" 1>&2 + exit 1 +fi + +pm2 startup +pm2 save +pm2 start --name addseed-web npm -- run start +pm2 set your-app-name autorestart true +pm2 save + +echo "PM2启动脚本执行完毕。" \ No newline at end of file