-
Notifications
You must be signed in to change notification settings - Fork 3
/
gw-hp.lif.35dd
executable file
·61 lines (48 loc) · 1.2 KB
/
gw-hp.lif.35dd
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
59
60
61
#!/usr/bin/env bash
# Format: HP LIF 35 Track Double Density
# gw diskdef: hp.lif.35dd
# External tools: hpdir (https://www.hp9845.net/9845/projects/hpdir/)
# Get project name
name="$1"
# Include parent script
if [[ -f "./gw-raw" ]]
then
parent="./gw-raw"
else
parent="$(which gw-raw)"
fi
source "$parent" "$name" "source"
# Output file names
img="$name.img"
# Overloaded function from gw-raw
function decode # 1-Nothing
{
echo "Decoding HP LIF 35 Track Double Density"
gw convert --diskdefs $diskdefs --format hp.lif.35dd "$raw" "$img" 2>&1 | tee -a $log_decode
}
# Overloaded function from gw-raw
function extract
{
echo "Extract files from [$img] here as a verification step"
#file "$img" 2>&1 | tee -a $log_extract
hpdir -list "$img" > "hpdir-list.txt"
hpdir -info "$img" > "hpdir-info.txt"
if [[ $? == 0 ]]
then
fcount="1"
mkdir -p "$img-files"
cd "$img-files"
for file in $(cat "../hpdir-list.txt" | grep -Ev 'VOLUME|.img|bytes free|REC/FILE' | awk '{print $1}')
do
echo "LIF Extract: [$img]"
hpdir -extract "../$img" $file -y
fcount="$(expr $fcount + 1)"
done
cd ../..
fi
}
# Create dir based on name and rip within it
mkdir -p "$name"
cd "$name"
rip B "c=0-39"
cd ..