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