|
|
@ -28,16 +28,18 @@ lsblk -o NAME | grep "^sd" | while read -r test1 ; do |
|
|
|
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}" | awk '$1=$1' | cut -d " " -f 2) |
|
|
|
echo " compare ${test2} size(${size2})" |
|
|
|
if [ "${size1}" = "${size2}" ]; then |
|
|
|
echo " MATCH ${test1} = ${test2}" |
|
|
|
# remember last match |
|
|
|
dev1="${test1}" |
|
|
|
dev2="${test2}" |
|
|
|
echo " MATCHING ${test2} size(${size2})" |
|
|
|
dev1=$(echo "${test1}") |
|
|
|
dev2=$(echo "${test2}") |
|
|
|
else |
|
|
|
echo " different ${test2} size(${size2})" |
|
|
|
fi |
|
|
|
done |
|
|
|
done |
|
|
|
echo "RESULT: ${dev1} & ${dev2}" |
|
|
|
echo "RESULTS:" |
|
|
|
echo "dev1(${dev1})" |
|
|
|
echo "dev2(${dev2})" |
|
|
|
|
|
|
|
exit 0 |
|
|
|
|
|
|
|