FIX setup-ngxblocker REF: #256 REF: #266

Reverting Changes introduced in Commit: 863bf14bab which switched method of find_line from awk to grep
This commit is contained in:
Mitchell Krog 2019-06-28 21:22:57 +02:00
parent 9b0224d0af
commit 34cec8f5a2
No known key found for this signature in database
GPG key ID: C243C388553EDE5D

View file

@ -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
}