Last active
June 29, 2018 06:56
-
-
Save mansurali901/e5288eb63c6dd6b13c9a82b7e3476aae to your computer and use it in GitHub Desktop.
This script will install Redis on Ubuntu or CentOS or RHEL7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script install Redis 4 in RHEL7 / Ubuntu | |
# This installation is done from source code. | |
# Author : Mansur Ul Hasan | |
# Email : [email protected] | |
# Main Function | |
InstallR () { | |
cd /usr/local/redis | |
make distclean | |
make | |
make install | |
cd utils/ | |
./install_server.sh | |
} | |
# Binaries Function for downloading | |
BinariesPkg () { | |
# Donwloading binaries | |
wget -O 4.0-rc3.tgz https://codeload.github.com/antirez/redis/tar.gz/4.0-rc3 | |
# mv 4.0-rc3 4.0-rc3.tgz | |
tar -xvzf 4.0-rc3.tgz | |
# mkdir -p /usr/local/redis | |
mv -v redis-4.0-rc3 /usr/local/redis | |
cd /usr/local/redis | |
# Calling Install Function | |
InstallR | |
} | |
PreReqRH () { | |
# Installing Development Tools | |
yum groupinstall 'Development Tools' | |
yum install tcl wget | |
# Calling binaries function | |
BinariesPkg | |
} | |
PreReqUB () { | |
# Installing pre requisites | |
apt-get install build-essential | |
apt-get install tcl wget | |
# Calling binaries function | |
BinariesPkg | |
} | |
# OS Check function | |
OSCheck () { | |
# OS Check | |
OSV=`cat /etc/issue |head -n1|awk '{print $1}'` | |
case $OSV in | |
"Ubuntu") | |
# Executing Ubuntu Prequisites | |
PreReqUB | |
;; | |
"\S") | |
# Executing RHEL7 pre requisites function | |
PreReqRH | |
;; | |
'Centos') | |
;; | |
*) | |
echo "Operating System not supported ..." | |
;; | |
esac) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment