Add script to flash images on block devices
This commit is contained in:
parent
c310c97249
commit
c80f3e83dd
1 changed files with 10 additions and 0 deletions
10
bin/flash
Executable file
10
bin/flash
Executable 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
|
Loading…
Reference in a new issue