Add script to flash images on block devices

This commit is contained in:
Talia 2020-02-04 21:56:59 +01:00
parent c310c97249
commit c80f3e83dd

10
bin/flash Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
if [ -z "$1" ]; then echo "No directory selected"; exit; fi
image=$(find $1 -name '*.iso' -or -name '.img' | dmenu -p 'Select Image' -i -b -l 20)
if ! [ -f "$image" ]; then echo "No file selected"; exit; fi
device=$(find /dev -name 'sd*' | sort | dmenu -p 'Select Device' -b -l 20)
if ! [ -b "$device" ]; then echo "No device selected"; exit; fi
sudo dd if=$image of=$device bs=4M status=progress