15 lines
295 B
Bash
15 lines
295 B
Bash
|
#!/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启动脚本执行完毕。"
|