The Mostly Harmless USB Disk https://mostlyharmless.io/usb/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

32 lines
1.1 KiB

#bin/bash
dd="sudo dd"
# Script to write debconf-edition image to multiple USBs
#A=/dev/disk/by-path/pci-0000:00:14.0-usb-0:2:1.0-scsi-0:0:0:0
#B=/dev/disk/by-path/pci-0000:00:14.0-usb-0:1:1.0-scsi-0:0:0:0
#C=/dev/disk/by-path/pci-0000:00:14.0-usb-0:4.4:1.0-scsi-0:0:0:0
#D=/dev/disk/by-path/pci-0000:00:14.0-usb-0:4.1:1.0-scsi-0:0:0:0
#E=/dev/disk/by-path/pci-0000:00:14.0-usb-0:4.3:1.0-scsi-0:0:0:0
#F=/dev/disk/by-path/pci-0000:00:14.0-usb-0:4.2:1.0-scsi-0:0:0:0
#Dell USB HUB
#G=/dev/disk/by-path/pci-0000:02:00.0-usb-0:2.3:1.0-scsi-0:0:0:0
#H=/dev/disk/by-path/pci-0000:02:00.0-usb-0:2.1:1.0-scsi-0:0:0:0
#I=/dev/disk/by-path/pci-0000:02:00.0-usb-0:2.4:1.0-scsi-0:0:0:0
while :; do
if [ -h $1 ]; then
#Check whether there is a USB drive at Physical USB port and it is a symlink to the device filename
echo "USB Drive present at $2,copying the image"
$dd if=$HOME/debconf-usb.img of=$1 status=progress bs=5M && notify-send "$2-done"
echo "Done - copied to $2 | Please Unplug the drive and insert another"
exit 1
else
echo "Please insert a USB disk at $2"
continue
fi
done