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