From 6d6853e95b7316b5d13a871f88918a595617deb3 Mon Sep 17 00:00:00 2001 From: mckmonster Date: Wed, 14 Sep 2022 18:28:32 +0200 Subject: [PATCH] Better fix for when line is empty --- tinystatus | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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}")"