Shell Script To Install Rar/Unrar On Linux

by admin on February 4, 2010 · 6 comments

in Shell Scripts


This is a bash script which installs  Rar/Unrar On A Linux System.
This script will first detect the decide weather the server has 64 bit or 32 bit Operating System installed and then will install the respective version of RAR/UNRAR.

#!/bin/bash
# simple bash script that will install rar
# By www.vpsgeek.info
echo "This script will install rar on your box"
# move to a temp director
cd /tmp
# detecting the architecture
if $(uname -a | grep 'x86_64'); then
echo "this is 64 bit os, so lets install 64bit winrar"
wget http://rarlab.com/rar/rarlinux-x64-3.8.0.tar.gz
tar -zxvf rarlinux-x64-3.8.0.tar.gz
cd rar
./unrar
else
echo "this is 32 bit os, so lets install 32bit winrar"
wget http://www.rarlab.com/rar/rarlinux-3.8.0.tar.gz
tar -zxvf rarlinux-3.8.0.tar.gz
cd rar
./unrar
fi
cp rar unrar /bin
echo "rar sucessfully installed"

Your can get the code in plain text format here

Feel Free To Post Suggestions,Errors,etc by commenting below

{ 6 comments… read them below or add one }

admin February 4, 2010 at 7:34 pm

testing a comment !

bebe February 5, 2010 at 1:24 am

thanks :D

bot February 7, 2010 at 2:04 am

Thanks !

Itsme February 7, 2010 at 12:06 pm

thanks !!

Ben February 25, 2010 at 12:26 pm

ok.nice

admin March 11, 2010 at 11:57 pm

Thanks for feedback <3

Leave a Comment

Next post: