Parcourir la source

opt: 优化运行脚本

sensordb2 il y a 1 mois
Parent
commit
29ee6f4bf2

+ 1 - 1
nginx-green-installer/安装说明.txt

@@ -1,5 +1,5 @@
 version: v1.0.0
-install.sh脚本用于自动将nginx-green时序数据库安装在/opt/nginx-green/nginx-green下
+install.sh脚本用于自动将nginx-green安装在/opt/nginx-green/nginx-green下
 如存在旧版本文件需要重新命名
 (以下操作均需通过root用户执行)
 1. chmod +x *.sh给脚本可执行权限

+ 0 - 13
nginx-green/nginx-launcher.sh

@@ -1,13 +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)"
-}
-
-./bin/nginx

+ 4 - 4
nginx-green/run.sh

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

+ 1 - 1
nginx-green/status.sh

@@ -8,7 +8,7 @@ base_dir=$(
     pwd
 )
 cd $base_dir
-server_pid=$(pgrep -x nginx || true)
+server_pid=$(pgrep -x nginx-green || true)
 if [[ $server_pid == "" ]]; then
     echo "nginx-green 未在运行"
 else