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 compressor()
{
case $(lowercase) in
*.tar)
if [ -x "$(command -v tar)" ]
then
tar -cvf $DEST $ORIG
else
error_not_install "tar"
fi
;;
*.tar.gz | *.tgz)
if [ -x "$(command -v tar)" ]
then
tar -czvf $DEST $ORIG
else
error_not_install "tar"
fi
;;
*.tar.bz2 | *.tbz | *.tbz2 | *.tb2)
if [ -x "$(command -v tar)" ]
then
tar -c $ORIG | bzip2 > $DEST
else
error_not_install "tar"
fi
;;
*.tar.xz | *.txz)
if [ -x "$(command -v tar)" ]
then
tar -cJf $DEST $ORIG
else
error_not_install "tar"
fi
;;
*.bz2)
if [ -x "$(command -v bzip2)" ]
then
bzip2 -c $ORIG > $DEST
else
error_not_install "bzip2"
fi
;;
*.gz)
if [ -x "$(command -v gzip)" ]
then
gzip -c $ORIG > $DEST
else
error_not_install "gzip"
fi
;;
*.zip)
if [ -x "$(command -v zip)" ]
then
zip -r $DEST $ORIG
else
error_not_install "zip"
fi
;;
*.7z)
if [ -x "$(command -v 7z)" ]
then
7z a $DEST $ORIG
else
error_not_install "7z"
fi
;;
*.rar)
if [ -x "$(command -v rar)" ]
then
rar a $DEST $ORIG
else
error_not_install "rar"
fi
;;
*)
echo "Extension not found."
echo -e "For more information run 'lch --help'\n"
;;
esac
echo -e "\nDone"
}