Looking at the usbmount package. I see that it includes the text: "USBmount is intended as a lightweight solution which is independent of a desktop environment. Users which would like an icon to appear when an USB device is plugged in should use the pmount and hal packages instead."
I really don't want to break normal operation. Never mind. Since udev (and HAL unless it's been merged into udev) is standard on recent distros, the log search method should be robust. I'll just include a prompt to re-insert the device (if it was left in during reboot or something).
#!/bin/bash # burn specified iso to usb flash (verifies that it IS on USB) fail() { echo Error: $*; exit 1; } [[ -z $(grep '\bdisk\b' < &1 | grep ID_BUS=usb) ]] \ && fail Please re-insert the USB device mod=$(udevadm info /dev/$dv | grep 'ID_MODEL=' | sed 's/.*ID_MODEL=//') read -p "Burn $1 into \"$mod\" at /dev/$dv [Yn]" yn [[ "$yn" == [nN]* ]] && exit 1 [[ "$1" == ?(*.zip|*.gz) ]] && fz=funzip || fz='tee' pv -tpreb "$1" | $fz | dd bs=1M oflag=dsync of="/dev/$dv"