-
Notifications
You must be signed in to change notification settings - Fork 5
/
ezdd
executable file
·48 lines (40 loc) · 900 Bytes
/
ezdd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Written By Woland
# burns ISO and IMG files to USB
# https://github.com/wolandark
# https://github.com/wolandark/BASH_Scripts_For_Everyone
while getopts ":hi:t:" opt; do
case $opt in
h)
echo "Usage: ./ezdd -i [path to .img or .iso file] -t [path to target USB device]"
exit 0
;;
i)
iso=$OPTARG
;;
t)
dev=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
if [[ -z $iso ]]; then
echo "Input .img or .iso file path:"
read -re iso
fi
if [[ -z $dev ]]; then
echo ""
lsblk
echo ""
echo -e "Input USB device path to write to. All device paths must start with /dev\nexample: /dev/sdb"
read -re dev
fi
sudo dd if=$iso of=$dev bs=4M status=progress
echo "Device is ready and bootable now"