Archive : Force pv to show progress.

This commit is contained in:
Dmitry Voronin 2024-03-11 23:43:45 +03:00
parent d11f20cc13
commit ce2271d100

View file

@ -224,7 +224,8 @@ function archive_name() {
}
# Extract previously created archive with checksum validation.
# Usage: unarchive [FILES]
# Supports unarchiving exact paths from the remote machines (rsync syntax).
# Usage: unarchive [HOST:FILES]
function unarchive() {
local IFS=$'\n'
local targets=(${@})
@ -247,10 +248,10 @@ function unarchive() {
# Extract.
case "${file##*.}" in
"txz")
${remote[@]} pv ${file} | xz -d | tar -xf -
${remote[@]} "pv -f" ${file} | xz -d | tar -xf -
;;
"tgz")
${remote[@]} pv ${file} | gzip -d | tar -xf -
${remote[@]} "pv -f" ${file} | gzip -d | tar -xf -
;;
esac
}