-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path04-extract.sh
More file actions
executable file
·31 lines (22 loc) · 904 Bytes
/
Copy path04-extract.sh
File metadata and controls
executable file
·31 lines (22 loc) · 904 Bytes
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
#!/bin/bash
# make sure 00-activate.sh is run beforehand
if [ -z ${DD_POSE_SOURCED+x} ]; then echo "DD_POSE_SOURCED environment variable is not set. Have you sourced 00-activate.sh?"; exit 1; fi
export DOWNLOAD_DIR=$DD_POSE_DATA_ROOT_DIR/00-download
echo "Extracting correctly downloaded data from $DOWNLOAD_DIR to $DD_POSE_DATA_DIR"
mkdir -p $DD_POSE_DATA_DIR
function untar()
{
local FILE=$1 # basename without .md5sum extension
local FILE_ABS=$DOWNLOAD_DIR/$FILE
echo -n "About to extract $FILE: "
if [ ! -f $FILE_ABS.md5sum-correct ]; then
echo "md5sum check was not successful. Skipping extraction. Have you run 03-compare-md5sums.sh?"
return 1
fi
if tar xzf $FILE_ABS -C $DD_POSE_DATA_DIR; then
echo "ok"
fi
}
# make function visible to gnu parallel
export -f untar
cat $DD_POSE_DIR/resources/download-file-names.txt | parallel untar {}