-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiso2usb.1.sh
58 lines (58 loc) · 1.35 KB
/
iso2usb.1.sh
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
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
if [[ "$#" == 0 ]]
then
clear
echo " "
echo "Interactive Mode.."
sleep 0.75
echo " "
sleep 0.75
echo "Desired ISO Image; File Path: "
sleep 0.75
read ISO
sleep 0.75
echo " "
sleep 0.75
echo "Desired USB Disk; Directory Path: "
sleep 0.75
read DISK
sleep 0.75
################## [[ $1 == "help" || "-h" || "--help" || ]] ##################
echo " "
sleep 0.75
echo "Imaging the USB drive. This can take some time. >30min is not unusual."
echo "No further feedback will be provided until the process is complete."
echo "Please be patient."
sleep 0.75
echo " "
sudo dd if="$ISO" of="$DISK" bs=1M
sleep 0.75
echo " "
elif [[ "$#" == 2 ]]
then
echo " "
sleep 0.75
echo "Imaging the USB drive. This can take some time. >30min is not unusual."
echo "No further feedback will be provided until the process is complete."
echo "Please be patient."
sleep 0.75
echo " "
sudo dd if="$1" of="$2" bs=1M
sleep 0.75
echo " "
else
clear
echo " "
echo "ISO2USB v0.1beta;"
echo "Create a bootable USB drive."
echo " "
sleep 0.75
echo "Usage: ./iso2usb.sh [ISO]... [DISK]..."
echo " ./iso2usb.sh [INPUT]. [OUTPUT]."
sleep 0.75
echo " "
echo "Example: ./iso2usb.sh '/user/directory/image-file-1.0-amd64.iso' '/dev/disk'"
echo " ./iso2usb.sh '/user/directory/image-file-1.0-amd64.iso' '/dev/sdb6'"
sleep 0.75
echo " "
fi