From 315ce2397efab99a8a15cd2bb73367b00f178418 Mon Sep 17 00:00:00 2001 From: William Harrington Date: Fri, 2 Apr 2021 11:08:30 -0500 Subject: Use if [[ ... ]] instead of [ ... ] and change retval check in setupdisk when checking exit code when creating partition. --- functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'functions.sh') diff --git a/functions.sh b/functions.sh index 63fa887..a260f66 100644 --- a/functions.sh +++ b/functions.sh @@ -8,7 +8,7 @@ download() wget -nc -q --show-progress --progress=dot "$url" 2>&1 | grep --line-buffered "%" | \ sed -u -e "s,\.,,g" | awk '{printf("\b\b\b\b%4s", $2)}' local retval="${PIPESTATUS[0]}" - if [ "${retval}" -ne 0 ]; then + if [[ "${retval}" -ne 0 ]]; then printf "%b" "${RED}FAILED! WGET EXIT (${retval})\n${RST}" exit "${retval}" fi @@ -41,7 +41,7 @@ function spinner() { local spintype=$2 - if [ -z "${spintype}" ] || [ "${spintype}" -ge "${numspinners}" ]; then + if [[ -z "${spintype}" ]] || [[ "${spintype}" -ge "${numspinners}" ]]; then spintype=$((RANDOM % numspinners)) fi -- cgit v1.2.3-54-g00ecf