38 lines
826 B
Bash
38 lines
826 B
Bash
#!/bin/bash
|
|
# xoa run tmux server lite trong rc.local
|
|
|
|
|
|
# Cai dat PM2 run Server lite
|
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
|
|
source ~/.bashrc
|
|
nvm install v16.18.1
|
|
npm install pm2 -g
|
|
cd /root/monitor/setup/
|
|
pm2 ecosystem
|
|
echo "
|
|
module.exports = {
|
|
apps : [
|
|
{
|
|
name: 'Server_lite',
|
|
cwd: '/root/BiFace_Server_Config_API',
|
|
script: 'server.js',
|
|
args: '',
|
|
interpreter: 'node',
|
|
restart_delay: 1000,
|
|
cron_restart: '0 0 * * *',
|
|
watch: false,
|
|
time: true
|
|
}
|
|
]
|
|
};
|
|
" > ecosystem.config.js
|
|
# Khởi chạy pm2 vs cấu hình vừa sửa
|
|
pm2 reload ecosystem.config.js
|
|
|
|
# Cài đặt pm2 khởi động cùng Win/Ubuntu
|
|
pm2 startup
|
|
# Copy-paste và chạy dòng script hiện trên màn hình
|
|
pm2 save
|
|
reboot
|
|
exit 0
|