LASTDISK=dmesg |grep "Attached SCSI removable disk" | cut -d '[' -f3 | cut -d']' -f1 | tac | head -1
[ ! -f "$1" ] && echo "$1 not found" && exit 1
echo "Write $1" to $LASTDISK ? Y/n
read key
if [ "$key" = "Y" ]
then
echo dd if=$1 of=/dev/$LASTDISK bs=4M status=progress oflag=sync
dd if=$1 of=/dev/$LASTDISK bs=4M status=progress oflag=sync
sync
echo done
else
echo cancel
fi
Copy ISO to USB