Explorar el Código

opt: 优化脚本

sensordb2 hace 1 mes
padre
commit
a453aa8cca
Se han modificado 3 ficheros con 5 adiciones y 20 borrados
  1. 2 2
      config/app.ini
  2. 3 3
      nginx-ui-green/run.sh
  3. 0 15
      nginx-ui-green/ui-launcher.sh

+ 2 - 2
config/app.ini

@@ -17,8 +17,8 @@ ErrorLogPath = /opt/nginx-green/nginx-green/logs/error.log
 LogDirWhiteList = /opt/nginx-green/nginx-green/logs
 ConfigDir = /opt/nginx-green/nginx-green/conf
 PIDPath = /opt/nginx-green/nginx-green/logs/nginx.pid
-TestConfigCmd = /opt/nginx-green/nginx-green/bin/nginx -t -c /opt/nginx-green/nginx-green/conf/nginx.conf
-ReloadCmd = /opt/nginx-green/nginx-green/bin/nginx -s reload
+TestConfigCmd = /opt/nginx-green/nginx-green/bin/nginx-green -t -c /opt/nginx-green/nginx-green/conf/nginx.conf
+ReloadCmd = /opt/nginx-green/nginx-green/bin/nginx-green -s reload
 RestartCmd = systemctl restart nginx-green
 
 [openai]

+ 3 - 3
nginx-ui-green/run.sh

@@ -51,11 +51,11 @@ if [[ ! -d "$base_dir/log" ]]; then
 fi
 
 # preparation check
-if [[ ! -f "$base_dir/ui-launcher.sh" ]]; then
+if [[ ! -f "$base_dir/bin/nginx-ui" ]]; then
     log_err "文件夹中缺少nginx-ui-green(主程序),无法运行" && exit 1
 fi
 
-if [[ ! -x "$base_dir/ui-launcher.sh" ]]; then
+if [[ ! -x "$base_dir/bin/nginx-ui" ]]; then
     log_err "nginx-ui-green无可执行权限,无法运行。请使用chmod" && exit 1
 fi
 
@@ -67,6 +67,6 @@ else
         mkdir "$log_path"
     fi
     log_file="nginx-ui-green_$(date "+%Y-%m-%d-%H:%M:%S").log"
-    ./ui-launcher.sh server --config-file=$base_dir/config/config.xml &> "${log_path}${log_file}" &
+    ./bin/nginx-ui -config $base_dir/config/app.ini &> "${log_path}${log_file}" &
     ./status.sh
 fi

+ 0 - 15
nginx-ui-green/ui-launcher.sh

@@ -1,15 +0,0 @@
-#!/bin/bash
-
-base_dir=$(
-    cd "$(dirname "$0")"
-    pwd
-)
-cd $base_dir
-
-yaml() {
-    python3 -c "import yaml;print(yaml.safe_load(open('$1'))$2)"
-}
-
-PATH=/opt/nginx-green/nginx-green/bin/:$PATH
-
-./bin/nginx-ui -config ./config/app.ini