🐉ql extra.sh 2021-07-30 23:34:42

This commit is contained in:
QL 2021-07-30 15:34:42 +00:00
parent 403c53466c
commit b9a9ef978e

View File

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
## Mod: Build20210730V1 ## Mod: Build20210731V1
## 添加你需要重启自动执行的任意命令,比如 ql repo ## 添加你需要重启自动执行的任意命令,比如 ql repo
## 安装node依赖使用 pnpm install -g xxx xxxBuild 20210728-002 及以上版本的 code.sh可忽略 ## 安装node依赖使用 pnpm install -g xxx xxxBuild 20210728-002 及以上版本的 code.sh可忽略
## 安装python依赖使用 pip3 install xxxBuild 20210728-002 及以上版本的 code.sh可忽略 ## 安装python依赖使用 pip3 install xxxBuild 20210728-002 及以上版本的 code.sh可忽略
@ -15,7 +15,7 @@
### 2若需要在此处使用请在设置区设置 ### 2若需要在此处使用请在设置区设置
## 3. Ninja ## 3. Ninja
### 1默认不启动和更新 ### 1默认不启动和更新
### 2若需要启动和更新则令 Ninja=up ### 2若需要启动和更新则令 Ninja=up。此情况下未运行成功将强制重装
#------ 设置区 ------# #------ 设置区 ------#
@ -120,8 +120,31 @@ done
# 🍪Ninja # 🍪Ninja
if [ "${Ninja}" = "up" ]; then update_Ninja_normal(){
cd /ql/ninja/backend && git checkout . && git pull && pnpm install && pm2 start && cp sendNotify.js /ql/scripts/sendNotify.js & [ ! -d /ql/ninja/backend ] && mkdir -p && git checkout . && git pull && pnpm install && pm2 start && cp sendNotify.js /ql/scripts/sendNotify.js &
}
reinstall_Ninja_force(){
ps -ef|grep ninja|grep -v grep
if [ $? -ne 0 ]
cd /ql
ps -ef|grep ninja|grep -v grep|awk '{print $1}'|xargs kill -9 && rm -rf /ql/ninja && rm -rf /ql/ninja
git clone https://github.com/MoonBegonia/ninja.git /ql/ninja ## 拉取仓库
cd /ql/ninja/backend
pnpm install ## 安装局部依赖
cp .env.example .env ## 复制环境变量配置文件
cp sendNotify.js /ql/scripts/sendNotify.js ## 复制通知脚本到青龙容器
pm2 start
fi
}
check_Ninja_all(){
update_Ninja_normal
reinstall_Ninja_force
}
if [ "Ninja" = "up" ]; then
check_Ninja_all &
fi fi
@ -194,4 +217,4 @@ install_dependencies_all(){
if [ "${Install}" = 'yes' ]; then if [ "${Install}" = 'yes' ]; then
install_dependencies_all & install_dependencies_all &
fi fi