summaryrefslogtreecommitdiff
path: root/extractAll.sh
blob: 8b8649fce3ee9fa35c3d260222f15a4300612280 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

root=`dirname "$0"`
root=`realpath "$root"`

while read -r F; do
	base=`basename "$F"`
	linear=`mktemp`
	destdir="${base}.extracted"
	echo "Extracting $F to $destdir"
	$root/linearizeDisk.py "$F" "$linear"
	$root/extractArchive.py -n -o "$destdir" "$linear"
	pushd "$destdir" || continue
	for G in ./*; do
		echo "Converting $G to ${G}.txt"
		$root/convertFileDs.py "$G" > "${G}.txt" || rm "${G}.txt"
	done
	popd
	rm "$linear"
done