From 0e9250c516a6c99b202fd0e1b13308febe8520d3 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Wed, 22 Nov 2023 15:22:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nginx/docker-compose.yml | 4 ++-- nginx/sh/xc.sh | 28 +++++----------------------- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/nginx/docker-compose.yml b/nginx/docker-compose.yml index c935905..27cb656 100644 --- a/nginx/docker-compose.yml +++ b/nginx/docker-compose.yml @@ -1,7 +1,7 @@ -version: '3.3' +version: '3' services: xcdn: - image: helloz/xcdn:xcdn202111172143 + image: helloz/xcdn:alpine-1.24.0 #environment: network_mode: "host" diff --git a/nginx/sh/xc.sh b/nginx/sh/xc.sh index 6fbca8f..65ef321 100644 --- a/nginx/sh/xc.sh +++ b/nginx/sh/xc.sh @@ -20,46 +20,31 @@ fi #启动脚本 function start(){ #运行nginx - $nginx -g "daemon off;" -c /data/xcdn/conf/nginx.conf + $nginx -g "daemon off;" #sleep 10 #tail -f /data/xcdn/logs/error.log } #停止脚本 function stop() { #运行nginx - $nginx -c /data/xcdn/conf/nginx.conf -s stop + $nginx -s stop } #退出脚本 function quit() { #运行nginx - $nginx -c /data/xcdn/conf/nginx.conf -s quit + $nginx -s quit } #重载配置 function reload(){ - $nginx -c /data/xcdn/conf/nginx.conf -t && $nginx -c /data/xcdn/conf/nginx.conf -s reload + $nginx -t && $nginx -s reload } # 检查配置 function check_conf() { - $nginx -c /data/xcdn/conf/nginx.conf -t + $nginx -t } -#强制更新配置 -function update(){ - cd /data/xcdn - git pull origin ${BRANCH} - reload -} - -#push代码 -function push(){ - cd /data/xcdn - git add /data/xcdn/conf/* - git add /data/xcdn/ssl/* - git commit -m "$(date +%Y-%m-%d/%H:%m)" - git push origin ${BRANCH} -} # 根据用户输入执行不同动作 case ${arg1} in @@ -78,9 +63,6 @@ case ${arg1} in '-t') check_conf ;; - 'update') - update - ;; *) echo 'Parameter error!' ;;