From 00e64cd8a442178e5dd5512451b7b07308f7eab2 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Wed, 12 Jan 2022 13:21:36 -0300 Subject: [PATCH] Run shellcheck (loc 126-138) --- install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index ecb6757..745953c 100755 --- a/install.sh +++ b/install.sh @@ -128,12 +128,12 @@ getSize() { sizeStr=$(whiptail --inputbox "Enter the size of the ${1} (in GB, for example 1.5GB)." 0 0 3>&1 1>&2 2>&3) exitIfCancel "You must enter a size." size=$(echo "$sizeStr" | grep -Eo '[-]?[0-9]+([.,]?[0-9]+)?' | head -n1 | sed 's/,/./g' | awk '{ print int($1 * 1024) }') - while [ $(echo $size | awk '{ print $1 <= 0 }') -eq 1 ]; do - sizeStr=$(whiptail --inputbox "Size cannot be less than or equal to zero. Please enter a new size." 0 0 3>&1 1>&2 2>&3) + while [ "$(echo "$size" | awk '{ print $1 <= 0 }')" -eq 1 ]; do + sizeStr=$(whiptail --inputbox "The size must be a number and cannot be less than or equal to zero. Please enter a new size." 9 60 3>&1 1>&2 2>&3) exitIfCancel "You must enter a size." size=$(echo "$sizeStr" | grep -Eo '[-]?[0-9]+([.,]?[0-9]+)?' | head -n1 | sed 's/,/./g' | awk '{ print int($1 * 1024) }') done - echo $size + echo "$size" } createSwapfile() {