Skip to content

Commit

Permalink
修改reload pm2逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhh committed May 29, 2021
1 parent 70e9c7f commit 11f7b49
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion shell/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,27 @@ update_qinglong() {
echo -e "重启面板中..."
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
sleep 1
pm2 reload all >/dev/null 2>&1
reload_pm2
else
echo -e "\n更新$dir_root失败,请检查原因...\n"
fi

}

reload_pm2() {
if [[ $(pm2 info panel 2>/dev/null) ]]; then
pm2 reload panel >/dev/null 2>&1
else
pm2 start $dir_root/build/app.js -n panel >/dev/null 2>&1
fi

if [[ $(pm2 info schedule 2>/dev/null) ]]; then
pm2 reload schedule >/dev/null 2>&1
else
pm2 start $dir_root/build/schedule.js -n schedule >/dev/null 2>&1
fi
}

## 对比脚本
diff_scripts() {
local dir_current=$(pwd)
Expand Down

0 comments on commit 11f7b49

Please sign in to comment.