Skip to content

Commit

Permalink
using first partition of source device
Browse files Browse the repository at this point in the history
  • Loading branch information
niccokunzmann committed Mar 3, 2017
1 parent fcc180d commit a6b3d4c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions files/opt/duplicate-usb-stick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ if [ -z "$source_device" ]; then
fi
partition="${device}1"

end="`sudo parted -s /dev/sdb 'unit b print' | awk '/^ / {print $3}'`"
end="`sudo parted -s \"$source_device\" 'unit b print' | awk '/^ / {print $3}' | head -n 1`"
bytes="${end%B}"
bytes="${bytes%b}"
start="`sudo parted -s /dev/sdb 'unit b print' | awk '/^ / {print $2}'`"
start="`sudo parted -s \"$source_device\" 'unit b print' | awk '/^ / {print $2}' | head -n 1`"

echo "Getting partitions of $device"
partitions="`sudo parted -s \"$device\" print|awk '/^ / {print $1}'`"
Expand Down

0 comments on commit a6b3d4c

Please sign in to comment.