#! / bin / bash # Author: Rosen Alexandrov (and thanks to gat3way) # About me: roko@jabber.calculate-linux.org, sandikata@yandex.ru, Skype ROKO__2 # Important for the script to work properly you need to put it in / usr / local / bin as well as have the "pv" package installed, at least in AltLinux it says so. if [`id -u` -ne 0]; then exec notify-send -t 10000 "You do not have administrator rights! Run the script as an administrator or with sudo dd-flash"; exit 1 fi echo "In order to create a Live Flash Drive you need to insert it into the USB port of your computer, and the Flash Drive must not be mounted!" echo echo "Full path to ISO (Example /home/user/Downloads/iso.iso)" read iso while! [-s $ iso]; to printf "The selected file does not exist. Please select an existing one. ->" read iso done echo while! fdisk -s $ flash &> / dev / null; to printf "Insert an existing flash drive. Example / dev / sdc ->" read flash done echo echo "The operation will destroy the information on your flash drive!" echo "Are you sure you want to continue?" select yn in "Yes" "No"; to case $ yn in # Uncomment this line if you want more information about the transfer Yes) dd if = $ iso | pv -ptr -N $ iso | dd of = $ flash ;; yes) (pv -n $ iso | dd of = $ flash bs = 128M conv = notrunc, noerror) 2> & 1 | dialog --gauge "Copy ... Please Wait ..."; exit 1 ;; No) exit ;; esac done