Better fix for when line is empty
This commit is contained in:
parent
2b97e1f19d
commit
6d6853e95b
1 changed files with 3 additions and 3 deletions
|
@ -25,9 +25,6 @@ check(){
|
||||||
host="${2}"
|
host="${2}"
|
||||||
name="${3}"
|
name="${3}"
|
||||||
expectedcode="${4}"
|
expectedcode="${4}"
|
||||||
if test -z ${ctype}
|
|
||||||
then return
|
|
||||||
fi
|
|
||||||
|
|
||||||
IPv="$(echo "${ctype}" | grep -o '[46]$')"
|
IPv="$(echo "${ctype}" | grep -o '[46]$')"
|
||||||
case "${ctype}" in
|
case "${ctype}" in
|
||||||
|
@ -62,6 +59,9 @@ command_exists 'ping'
|
||||||
mkdir -p "${tmp}/ok" "${tmp}/ko" || exit 1
|
mkdir -p "${tmp}/ok" "${tmp}/ko" || exit 1
|
||||||
|
|
||||||
while IFS="$(printf '\n')" read -r line; do
|
while IFS="$(printf '\n')" read -r line; do
|
||||||
|
if test -z ${line}
|
||||||
|
then continue
|
||||||
|
fi
|
||||||
ctype="$(get_element 1 "${line}")"
|
ctype="$(get_element 1 "${line}")"
|
||||||
code="$(get_element 2 "${line}")"
|
code="$(get_element 2 "${line}")"
|
||||||
name="$(get_element 3 "${line}")"
|
name="$(get_element 3 "${line}")"
|
||||||
|
|
Loading…
Reference in a new issue