From f7eee12720637046e1e081a0de8f625caa81e3fe Mon Sep 17 00:00:00 2001 From: openoms Date: Wed, 8 May 2019 13:16:00 +0100 Subject: [PATCH] fix hdd chack output --- home.admin/30initHDD.sh | 4 ++-- home.admin/_bootstrap.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/home.admin/30initHDD.sh b/home.admin/30initHDD.sh index 4a0856c..454243f 100755 --- a/home.admin/30initHDD.sh +++ b/home.admin/30initHDD.sh @@ -16,7 +16,7 @@ if [ ${existsHDD} -eq 1 ]; then existsHDD2=$(lsblk | grep -c sda2) hddSecondDriveExists=$(lsblk | grep -c sdb) if [ ${existsHDD2} -eq 1 ] || [ ${hddSecondDriveExists} -eq 1 ] ; then - echo "OK - HDD found at sda2 ... determine which is bigger" + echo "OK - another HDD found at sdb ... determine which is bigger" # get both with size size1=$(lsblk -o NAME,SIZE -b | grep "sda1" | awk '{ print substr( $0, 12, length($0)-2 ) }' | xargs) @@ -24,7 +24,7 @@ if [ ${existsHDD} -eq 1 ]; then size2=$(lsblk -o NAME,SIZE -b | grep "sda2" | awk '{ print substr( $0, 12, length($0)-2 ) }' | xargs) echo "sda2(${size2})" size3=$(lsblk -o NAME,SIZE -b | grep "sdb" | awk '{ print substr( $0, 8, length($0)-2 ) }' | xargs) - echo "sdb(${size2})" + echo "sdb(${size3})" # choose to run with the bigger one if [ ${size2} -gt ${size1} ]; then diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index 5562281..8c6c278 100644 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -157,7 +157,7 @@ if [ ${hddIsAutoMounted} -eq 0 ]; then size2=$(lsblk -o NAME,SIZE -b | grep "sda2" | awk '{ print substr( $0, 12, length($0)-2 ) }' | xargs) echo "sda2(${size2})" >> $logFile size3=$(lsblk -o NAME,SIZE -b | grep "sdb" | awk '{ print substr( $0, 8, length($0)-2 ) }' | xargs) - echo "sdb(${size2})" >> $logFile + echo "sdb(${size3})" >> $logFile # choose to run with the bigger one if [ ${size2} -gt ${size1} ]; then echo "sda2 is BIGGER - run with this one" >> $logFile