Linux Compression Humanized
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.
 
 

76 lines
1.8 KiB

#!/bin/bash
VERSION=0.4r1
DEST=$1
shift 1
ORIG=$@
if [ -z /usr/lib/lch/compressor.sh ]; then . /usr/lib/lch/compressor.sh; else . ./lib/compressor.sh; fi
if [ -z /usr/lib/lch/decompressor.sh ]; then . /usr/lib/lch/decompressor.sh; else . ./lib/decompressor.sh; fi
if [ -z /usr/lib/lch/check.sh ]; then . /usr/lib/lch/check.sh; else . ./lib/check.sh; fi
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 /flie1 /flie2 - Compress multiple"
echo ""
echo "Supported extensions:"
echo " rar, tar, tar.gz, tar.bz2, tar.xz, bz2, tgz, gz, zip, 7z"
echo ""
echo "Run 'man lch' for more info."
echo ""
}
if [ "$DEST" = "--help" ] || [ "$DEST" = "-h" ]
then
help
exit 0
fi
if [ "$DEST" = "--check" ] || [ "$DEST" = "-c" ]
then
check
exit 0
fi
if [ "$DEST" = "--install" ] || [ "$DEST" = "-i" ]
then
install $DEST $@
exit 0
fi
if [ "$DEST" = "--version" ] || [ "$DEST" = "-v" ]
then
echo "Linux Compression Humanized $VERSION"
exit 0
else
echo -e "\nlch $VERSION"
echo -e "---------\n"
fi
if [ -z "$DEST" ]
then
help
exit 1
else
if [ -n "$ORIG" ]
then
echo "Compressor:"
echo -e "-----------\n"
compressor $DEST $ORIG
else
echo "Decompressor:"
echo -e "-------------\n"
decompressor $DEST
fi
fi