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.
 

64 lines
1.8 KiB

#!/usr/bin/env bash
function help()
{
echo "Help:"
echo "-----"
echo ""
echo "lch [-h] [-v] [-c] [-i] [FILE [FILE...]]"
echo ""
echo "Examples:"
echo "$ lch -h - This help"
echo "$ lch -v - Print version"
echo "$ lch -c - Check compresion systems"
echo "$ lch -i - Install the compressors dependencies"
echo "$ lch file.zip - Decompress"
echo "$ lch file.zip /home/file - Compress"
echo "$ lch files.zip file1 file2 - Compress multiple"
echo ""
echo "Packing/unpacking supported extensions:"
echo " 7z, bz2, gz, rar, tar, tar.bz2, tar.gz, tar.xz, tgz, zip"
echo ""
echo "Unpacking only supported extensions:"
echo " arj, cab, dmg, iso, lzh, lzma, rpm, SquashFS"
echo ""
echo "Unpacking only in beta extensions:"
echo " cdi, chd, vmdk, win, xar, z"
echo ""
echo "Run 'man lch' for more info."
echo ""
}
function check()
{
local a=false
echo -e "Verification of compression systems:\n"
echo -e "Systems\t\t\tStatus"
echo "----------------------------------"
for i in "rar" "unrar" "tar" "bzip2" "gzip" "zip" "unzip" "7za"
do
if ! [ -x "$(command -v $i)" ]
then
echo -e "$i\t\t\t\e[91mNot Installed\e[0m"
$a = true
else
echo -e "$i\t\t\t\e[32mInstalled\e[0m"
fi
done
if $a
then
echo -e "\nIn order to use all the extensions install the packages: tar, bzip2, gzip, zip, unzip, 7za, rar, unrar"
fi
echo ""
}
function lowercase()
{
echo "$DEST" | tr 'A-Z' 'a-z'
}
function error_not_install()
{
echo -e "$@ \e[91mis not Installed\e[0m, use 'lch -i' to install and 'lch -c' to check."
}