@@ -1,15 +1,13 @@
#!/usr/bin/env bash
# 功能:安装 brotli 压缩工具
-# 依赖:cmake(yum install -y cmake)
git clone --depth 1 https://github.com/google/brotli.git
cd brotli
-./configure-cmake
make
mkdir -p ~/tools
-mv brotli ~/tools
+mv bin/brotli ~/tools
cd ..
rm -rf brotli
@@ -2,10 +2,11 @@
# 功能:定时调用 backup.sh
echo "log svc running"
+CUR_DIR=$(cd `dirname $0` && pwd)
# 也可用 crontab
while true
do
- ./backup.sh
+ $CUR_DIR/backup.sh
sleep 60
done
@@ -16,6 +16,9 @@ local function buildDevTrafficFn(dev)
return function(str)
local m = ngx.re.match(str, regex, 'oi')
+ if m == nil then
+ return '0,0'
+ end
local sRxBytes = m[1]
local sTxBytes = m[2]
@@ -1,10 +1,4 @@
-NGX_BIN=/home/jsproxy/openresty/nginx/sbin/nginx
-
-# local test
-if [ ! -f $NGX_BIN ]; then
- NGX_BIN=/usr/local/openresty/nginx/sbin/nginx
-fi
+NGX_BIN=$HOME/openresty/nginx/sbin/nginx
CUR_DIR=$(cd `dirname $0` && pwd)
if [ $1 ]; then