2024-10-22 15:36:41 +08:00
|
|
|
#!/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
|
2025-02-10 21:17:13 +08:00
|
|
|
pm2 set addseed-web autorestart true
|
2024-10-22 15:36:41 +08:00
|
|
|
pm2 save
|
|
|
|
|
|
|
|
echo "PM2启动脚本执行完毕。"
|