From fccfbf7649c6c07bc8e5cd6a6d7fa61a5e10d98b Mon Sep 17 00:00:00 2001 From: Christian Rotzoll Date: Mon, 25 Feb 2019 02:17:27 +0100 Subject: [PATCH] fix size detection --- home.admin/config.scripts/blitz.datadrive.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home.admin/config.scripts/blitz.datadrive.sh b/home.admin/config.scripts/blitz.datadrive.sh index 5ec3074..b563974 100644 --- a/home.admin/config.scripts/blitz.datadrive.sh +++ b/home.admin/config.scripts/blitz.datadrive.sh @@ -24,10 +24,10 @@ echo "Detecting two USB sticks/drives with same size ..." dev1="" dev2="" lsblk -o NAME | grep "^sd" | while read -r test1 ; do - size1=$(lsblk -o NAME,SIZE -b | grep "^${test1}") + size1=$(lsblk -o NAME,SIZE -b | grep "^${test1}" | awk '$1=$1' | cut -d " " -f 2) echo "Checking : ${test1} size(${size1})" lsblk -o NAME | grep "^sd" | grep -v "${test1}" | while read -r test2 ; do - size2=$(lsblk -o NAME,SIZE -b | grep "^${test2}") + size2=$(lsblk -o NAME,SIZE -b | grep "^${test2}" | awk '$1=$1' | cut -d " " -f 2) echo " compare ${test2} size(${size2})" if [ "${size1}" = "${size2}" ]; then echo " MATCH ${test1} = ${test2}"