fix hdd chack output

This commit is contained in:
openoms
2019-05-08 13:16:00 +01:00
parent 8f12a06e33
commit f7eee12720
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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