diff --git a/tinystatus b/tinystatus index 0cf9923..7a98124 100755 --- a/tinystatus +++ b/tinystatus @@ -25,9 +25,6 @@ check(){ host="${2}" name="${3}" expectedcode="${4}" - if test -z ${ctype} - then return - fi IPv="$(echo "${ctype}" | grep -o '[46]$')" case "${ctype}" in @@ -62,6 +59,9 @@ command_exists 'ping' mkdir -p "${tmp}/ok" "${tmp}/ko" || exit 1 while IFS="$(printf '\n')" read -r line; do + if test -z ${line} + then continue + fi ctype="$(get_element 1 "${line}")" code="$(get_element 2 "${line}")" name="$(get_element 3 "${line}")"