Linux Compressor Humanizer https://lch.hatthieves.es
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

85 lines
2.0 KiB

#!/usr/bin/env bash
function decompressor()
{
case $(lowercase) in
*.tar)
if [ -x "$(command -v tar)" ]
then
tar -xvf $DEST
else
error_not_install "tar"
fi
;;
*.tar.gz | *.tgz)
if [ -x "$(command -v tar)" ]
then
tar -xzvf $DEST
else
error_not_install "tar"
fi
;;
*.tar.bz2 | *.tbz | *.tbz2 | *.tb2)
if [ -x "$(command -v tar)" ]
then
tar xjf $DEST
else
error_not_install "tar"
fi
;;
*.tar.xz | *.txz)
if [ -x "$(command -v tar)" ]
then
tar -xf $DEST
else
error_not_install "tar"
fi
;;
*.bz2)
if [ -x "$(command -v bzip2)" ]
then
bzip2 -d $DEST
else
error_not_install "bzip2"
fi
;;
*.gz)
if [ -x "$(command -v gzip)" ]
then
gzip -d $DEST
else
error_not_install "gzip"
fi
;;
*.zip)
if [ -x "$(command -v unzip)" ]
then
unzip $DEST
else
error_not_install "unzip"
fi
;;
*.7z | *.arj | *.cab | *.cdi | *.chd | *.dmg | *.iso | *.lzh | *.lzma | *.rpm | *.squashfs | *.vmdk | *.win | *.xar | *.z)
if [ -x "$(command -v 7z)" ]
then
7z e -y $DEST
else
error_not_install "7z"
fi
;;
*.rar)
if [ -x "$(command -v unrar)" ]
then
unrar x $DEST
else
error_not_install "unrar"
fi
;;
*)
echo "Extension not found."
echo -e "For more information run 'lch --help'\n"
;;
esac
echo -e "\nDone"
}