summaryrefslogtreecommitdiff
path: root/scripts/extract.sh
blob: 5205bee0f6a384e9d53d97d77d83ccc96dbe9b8a (plain)
1
2
3
4
5
6
7
8
9
10
11
file=$1
shift

case $file in
*.tar.gz|*.tgz) tool=gzip  ;;
*.tar.bz2)      tool=bzip2 ;;
*.tar.xz)       tool=xz    ;;
*) exit 0
esac

"$tool" -d -c "$file" | "$PAX" -r "$@"