diff --git a/lch b/lch index e96219d..0642282 100755 --- a/lch +++ b/lch @@ -31,6 +31,9 @@ function decompressor() *.7z) 7za e $DEST ;; + *.rar) + unrar x $DEST + ;; *) echo "Extension not found." echo -e "For more information run 'lch --help'\n" @@ -68,6 +71,9 @@ function compressor() *.7z) 7za a $DEST $ORIG ;; + *.rar) + rar a $DEST $ORIG + ;; *) echo "Extension not found." echo -e "For more information run 'lch --help'\n" @@ -94,7 +100,7 @@ function help() echo "$ lch file.zip -Decompress" echo "" echo "Supported extensions:" - echo " tar, tar.gz, tar.bz2, tar.xz, bz2, tgz, gz, zip, 7z" + echo " rar, tar, tar.gz, tar.bz2, tar.xz, bz2, tgz, gz, zip, 7z" echo "" echo "Run 'man lch' for more info." echo "" @@ -119,7 +125,7 @@ function check() if $a then - echo -e "\nIn order to use all the extensions install the packages: tar, bzip2, gzip, zip, 7za" + echo -e "\nIn order to use all the extensions install the packages: tar, bzip2, gzip, zip, 7za, rar, unrar" fi echo "" exit 0 @@ -138,7 +144,7 @@ function install() if [ -x "$(command -v apt)" ] then echo -e "APT system detected\n" - apt install -y tar bzip2 gzip zip p7zip-full 1> /dev/null + apt install -y tar bzip2 gzip zip p7zip-full rar unrar-free 1> /dev/null elif [ -n "$(grep "centos" /etc/*-release)" ] then echo -e "CentOS system detected\n"