Browse Source

一些优化

main
xiaoz 12 months ago
parent
commit
0e9250c516
  1. 4
      nginx/docker-compose.yml
  2. 28
      nginx/sh/xc.sh

4
nginx/docker-compose.yml

@ -1,7 +1,7 @@ @@ -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"

28
nginx/sh/xc.sh

@ -20,46 +20,31 @@ fi @@ -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 @@ -78,9 +63,6 @@ case ${arg1} in
'-t')
check_conf
;;
'update')
update
;;
*)
echo 'Parameter error!'
;;

Loading…
Cancel
Save