mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-01 18:19:55 +00:00
Reverting Changes introduced in Commit: 863bf14bab
which switched method of find_line from awk to grep
This commit is contained in:
parent
9b0224d0af
commit
34cec8f5a2
1 changed files with 5 additions and 2 deletions
|
@ -219,8 +219,11 @@ find_line() {
|
|||
|
||||
case "$first_last" in
|
||||
# ignore file #comments
|
||||
first) grep -nE "^[ ]+$find_str" $file | head -n1 | awk -F: '{print $1}';;
|
||||
last) grep -nE "^[ ]+$find_str" $file | tail -n1 | awk -F: '{print $1}';;
|
||||
#first) grep -nE "^[ ]+$find_str" $file | head -n1 | awk -F: '{print $1}';;
|
||||
#last) grep -nE "^[ ]+$find_str" $file | tail -n1 | awk -F: '{print $1}';;
|
||||
# REVERTING TO ORIGINAL WORKING METHOD
|
||||
first) awk "/$find_str/{ print NR; exit }" $file;;
|
||||
last) awk "/$find_str/{ print NR }" $file | tail -n1;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue