From 4a0a540cd030673ed9046cd66c57abff235ad517 Mon Sep 17 00:00:00 2001 From: Hong Phuc Nguyen Date: Mon, 22 May 2017 03:58:48 +0700 Subject: [PATCH 1/2] Fix bug in check number of arguments Fix bug in check number of arguments not allow to set max threads --- nginx-cache-inspector | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx-cache-inspector b/nginx-cache-inspector index 1a54bf7..967bcbf 100755 --- a/nginx-cache-inspector +++ b/nginx-cache-inspector @@ -37,7 +37,7 @@ function print_usage() { } ## Check the number of arguments. -if [ $# -ne 2 ]; then +if [ $# -ne 2 ] && [ $# -ne 3 ]; then print_usage exit 1 fi From 2217a409a9610a169a860741b8d91f446277375a Mon Sep 17 00:00:00 2001 From: Hong Phuc Nguyen Date: Mon, 10 Jul 2017 17:45:16 +0700 Subject: [PATCH 2/2] Fix bug cannot get TTL --- nginx-cache-inspector | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx-cache-inspector b/nginx-cache-inspector index 967bcbf..edef3e3 100755 --- a/nginx-cache-inspector +++ b/nginx-cache-inspector @@ -64,7 +64,7 @@ function get_cache_item_key() { ## Get a cache item TTL. ## $1 - cache file. function get_cache_item_ttl() { - od -dL $1 | sed -n '2p' | awk '{print $1 - $2}' + od -dL $1 | sed -n '4p' | awk '{print $2 - $1}' } # get_cache_item_ttl ## Inspects an item from the given cache zone.