Improve Regex of Test Unit REF: #264

This commit is contained in:
Mitchell Krog 2019-06-21 09:30:04 +02:00
parent 7c9b1298b2
commit eac2158ce4
No known key found for this signature in database
GPG key ID: C243C388553EDE5D
2 changed files with 2 additions and 2 deletions

View file

@ -237,7 +237,7 @@ rm ${_inputdb3}
printf '%s\n' "$_start4" >> ${_tmpnginx4} printf '%s\n' "$_start4" >> ${_tmpnginx4}
while IFS= read -r LINE while IFS= read -r LINE
do do
printf '\t"~*%s%s"\t\t%s\n' "${LINE}" "(?:\.|\b|\/|[1-9])" "$_action4" >> ${_tmpnginx4} printf '\t"~*%s%s"\t\t%s\n' "(?:\.|\b|\/|[1-9])${LINE}" "(?:\.|\b|\/|[1-9])" "$_action4" >> ${_tmpnginx4}
#printf '\t"~*%s"\t\t%s\n' "${LINE}" "$_action4" >> ${_tmpnginx4} #printf '\t"~*%s"\t\t%s\n' "${LINE}" "$_action4" >> ${_tmpnginx4}
done < ${_input4} done < ${_input4}
printf '%s\n' "$_end4" >> ${_tmpnginx4} printf '%s\n' "$_end4" >> ${_tmpnginx4}

View file

@ -281,7 +281,7 @@ run_curltest13
run_curltest14 () { run_curltest14 () {
truncate -s 0 ${_curltest14} truncate -s 0 ${_curltest14}
printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING BAD BOT IS DENIED" "#########################" printf '\n%s\n%s\n%s\n\n' "#########################" "TESTING GOOD BOT IS ALLOWED" "#########################"
printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest14}" printf '%s%s\n\n' "Last Tested: " "$_now" >> "${_curltest14}"
curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000/index.php 2>> ${_curltest14} curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0" http://localhost:9000/index.php 2>> ${_curltest14}
if grep -i 'Welcome' ${_curltest14}; then if grep -i 'Welcome' ${_curltest14}; then