summaryrefslogtreecommitdiff
path: root/sdrive
blob: 7814fe311e6e737ff8acc7f5847df9b55370b2fc (plain)
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
#!/bin/sh

# Paths
drive=/dev/fd0

# Functions
prepDrive() {
    echo 'preparing drive...'
    setfdprm $drive sect=10 hd ssize=1024 cyl=80
}

formatDisk() {
    echo 'formatting disk...'
    superformat $drive sect=10 hd ssize=1024 cyl=80
}

iptImg() {
    echo 'Enter the destination file path'
    read iptloc
    echo 'importing...'
    cat $drive > $iptloc
}

writeDisk() {
    echo 'Enter img path'
    read iptimg
    echo 'writting'
    cat $iptimg > $drive
}

echo " 
    ######################################
    #   S-Series Drive :: Shell Script   #
    ######################################

          What would you like to do?
          
            1. Prepare drive
            2. Format disk
            3. Import img from disk
            4. Write img to disk
"

read choice

case "$choice" in
    1) prepDrive ;;
    2) formatDisk ;;
    3) iptImg ;;
    4) writeDisk ;;
esac