X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Farchival%2Funpack.sh;h=f5c2aa93a2623158a169b475a280e1685c05f497;hb=bffe9fba70b7ea1ab1b5d963b811d4637b021ee1;hp=cabb65d397dc5b0fb4c91a6f77ebc83c84aba36c;hpb=e715c6598343dd15a8652cd22923c4e48aaf1aef;p=feisty_meow.git diff --git a/scripts/archival/unpack.sh b/scripts/archival/unpack.sh index cabb65d3..f5c2aa93 100644 --- a/scripts/archival/unpack.sh +++ b/scripts/archival/unpack.sh @@ -37,7 +37,7 @@ if [ ! -d "$unpack_dir" ]; then fi # save where we started out. -ORIGINATING_FOLDER="$( \cd "$(\dirname "$0")" && \pwd )" +ORIGINATING_FOLDER="$( \pwd )" pushd "$unpack_dir" &>/dev/null @@ -51,21 +51,28 @@ if [ ! -f "$unpack_file" ]; then fi fi -if [[ $unpack_file =~ .*\.tar ]]; then - tar -f $unpack_file -elif [[ $unpack_file =~ .*\.tar\.gz \ - || $unpack_file =~ .*\.tar\.bz2 \ - || $unpack_file =~ .*\.tgz ]]; then - tar -xf $unpack_file -elif [[ $unpack_file =~ .*\.zip ]]; then - unzip $unpack_file +if [[ $unpack_file =~ .*\.tar$ \ + || $unpack_file =~ .*\.tar\.gz$ \ + || $unpack_file =~ .*\.tar\.bz2$ \ + || $unpack_file =~ .*\.iar$ \ + || $unpack_file =~ .*\.oar$ \ + || $unpack_file =~ .*\.tgz$ \ + ]]; then + tar -xf $unpack_file &>/dev/null +elif [[ $unpack_file =~ .*\.zip$ \ + || $unpack_file =~ .*\.odt$ \ + || $unpack_file =~ .*\.jar$ \ + || $unpack_file =~ .*\.war$ \ + ]]; then + unzip $unpack_file &>/dev/null fi save_err=$? +popd &>/dev/null + if [ $save_err -ne 0 ]; then echo "There was a failure reported while unpacking: $unpack_file" echo "into the directory: $unpack_dir" - popd &>/dev/null exit 1 else echo "Unpacked file $(basename $unpack_file) into folder: $unpack_dir"