|
|
@ -60,6 +60,10 @@ if [ ! -f "$satellite" ]; then |
|
|
|
exiterr "Can't find satellite file" |
|
|
|
fi |
|
|
|
|
|
|
|
# Configuration |
|
|
|
cmd_download="curl -#L -o {dst} {src}" |
|
|
|
cmd_extract="tar xf {src}" |
|
|
|
|
|
|
|
# Tools for the astronaut |
|
|
|
mksum() { |
|
|
|
echo $(md5sum "$@" 2> /dev/null | cut -d' ' -f1) |
|
|
@ -75,11 +79,12 @@ download() { |
|
|
|
if [ ! -f "$path" -o "$checksum" != "$2" ]; then |
|
|
|
msg "Downloading $name" |
|
|
|
if [ "$3" ]; then |
|
|
|
local cmd="$(echo "$2" | sed -e 's@{dst}@'"$path"'@g' -e 's@{source}@'"$1"'@g')" |
|
|
|
$cmd |
|
|
|
local cmd="$3" |
|
|
|
else |
|
|
|
curl -#L -o "$path" "$1" |
|
|
|
local cmd="$cmd_download" |
|
|
|
fi |
|
|
|
$(echo "$cmd" | sed -e 's@{dst}@'"$path"'@g' -e 's@{src}@'"$1"'@g') |
|
|
|
|
|
|
|
checksum="$(mksum "$path")" |
|
|
|
if [ "$2" -a "$checksum" != "$2" ]; then |
|
|
|
msg "Checksum: $checksum" |
|
|
@ -91,11 +96,11 @@ download() { |
|
|
|
extract() { |
|
|
|
msg "Extracting $1" |
|
|
|
if [ "$2" ]; then |
|
|
|
local cmd="$(echo "$2" | sed -e 's@{src}@'"$dir_source/$1"'@g')" |
|
|
|
$cmd |
|
|
|
local cmd="$2" |
|
|
|
else |
|
|
|
tar xf "$dir_source/$1" |
|
|
|
local cmd="$cmd_extract" |
|
|
|
fi |
|
|
|
$(echo "$cmd" | sed -e 's@{src}@'"$dir_source/$1"'@g') |
|
|
|
} |
|
|
|
|
|
|
|
dlextract() { |
|
|
|