npm 启动增加 reload 逻辑

This commit is contained in:
whyour 2024-07-14 14:37:26 +08:00
parent 16df451fe0
commit 11be9c47eb

View File

@ -27,6 +27,14 @@ if [[ ! $QL_DATA_DIR ]]; then
exit 1
fi
command="$1"
if [[ $command == "reload" ]]; then
mkdir -p /run/nginx
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
exit 1
fi
# 安装依赖
os_name=$(source /etc/os-release && echo "$ID")
@ -92,6 +100,9 @@ if [[ $EnableExtraShell == true ]]; then
echo -e "自定义脚本后台执行中...\n"
fi
pm2 startup
pm2 save
echo -e "############################################################\n"
echo -e "启动完成..."
echo -e "############################################################\n"