Restrict IPv var to 4 or 6
Restrict the grep to only 4 or 6 to prevent unintended command line switch from being executed.
This commit is contained in:
parent
23e591ad46
commit
f18e8e8221
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ check(){
|
||||||
name="${3}"
|
name="${3}"
|
||||||
expectedcode="${4}"
|
expectedcode="${4}"
|
||||||
|
|
||||||
IPv="$(echo "${ctype}" | grep -o '[0-9]$')"
|
IPv="$(echo "${ctype}" | grep -o '[46]$')"
|
||||||
case "${ctype}" in
|
case "${ctype}" in
|
||||||
http*)
|
http*)
|
||||||
statuscode="$(curl -${IPv}sSkLo /dev/null -H "${useragent}" -m "${timeout}" -w "%{http_code}" "${host}" 2> "${tmp}/ko/${name}.error")";;
|
statuscode="$(curl -${IPv}sSkLo /dev/null -H "${useragent}" -m "${timeout}" -w "%{http_code}" "${host}" 2> "${tmp}/ko/${name}.error")";;
|
||||||
|
|
Loading…
Reference in a new issue