Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* Better sed pattern to match key.

  • Loading branch information...
commit d7f81051141a86b5bd95dff786d9a4d5a200248a 1 parent 193fc01
@perusio authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 nginx-cache-inspector
View
9 nginx-cache-inspector
@@ -61,13 +61,12 @@ function get_cache_files() {
## is to filter.
function get_cache_item_key() {
if [ $# -eq 1 ]; then
- local key_line=$(cat $1 | sed -n '2p' | cut -f 2 -d ':')
+ local key_line=$(cat $1 | sed -n '/^KEY:/p' | cut -f 2 -d ':')
## Filter all non ASCII based keys.
- if echo $key_line | grep -q -vP '[^[:print:]]'; then
- echo $key_line
- fi
+ echo $key_line | grep -q -vP '[^[:print:]]'
+
else
- cat $1 | sed -n '2p' | cut -f 2 -d ':'
+ cat $1 | sed -n '/^KEY:/p' | cut -f 2 -d ':'
fi
} # get_cache_item_key
Please sign in to comment.
Something went wrong with that request. Please try again.