Hm, i wonder if
$(mount | grep -qF "$device on /cdrom ") && continue
is broken ever since UEFI was introduced, since now $device1 is mounted not simply $device.
Hm, i wonder if
$(mount | grep -qF "$device on /cdrom ") && continue
is broken ever since UEFI was introduced, since now $device1 is mounted not simply $device.