Browse Source

fix same size detection

dev
Christian Rotzoll 6 years ago
parent
commit
6a72e48228
  1. 10
      home.admin/config.scripts/blitz.datadrive.sh

10
home.admin/config.scripts/blitz.datadrive.sh

@ -20,15 +20,15 @@ sudo apt-get install -y btrfs-tools
# detect the two usb drives
echo "Detecting two USB sticks with same size ..."
echo "Detecting two USB sticks/drives with same size ..."
dev1=""
dev2=""
lsblk -o NAME | grep "^sd" | grep -v "sda" | while read -r test1 ; do
lsblk -o NAME | grep "^sd" | while read -r test1 ; do
size1=$(lsblk -o NAME,SIZE -b | grep "^${test1}")
echo "Checking : ${test1} -> ${size1}"
lsblk -o NAME | grep "^sd" | grep -v "sda" | while read -r test2 ; 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}")
echo " compare with ${test2} -> ${size2}"
echo " compare ${test2} size(${size2})"
if [ "${size1}" = "${size2}" ]; then
echo " MATCH ${test1} = ${test2}"
# remember last match

Loading…
Cancel
Save