Redis Automated Installation Scripts

Source: Internet
Author: User

Redis Automatic Installation script: Installation directory:/usr/local/redis binaries:/usr/local/bin config file:/usr/local/redis/etc, config file itself according to its own business to configure, here is just an empty file. log file :/usr/local/redis/logs data file:/usr/local/redis/dump#!/bin/bashsoft_dir= "/home/tools" download_url= "/HTTP/ Download.redis.io/releases/redis-2.8.19.tar.gz "redis_version=" 2.8.19 "Root_or_not () {if [  ' id -u '  != 0 ] ; then    echo -e  "\e[1;44m  <==== you are not root,please login in root!====> \e[0m "     exit 1fi}install_or_not () {    read -p  "Install redis, Input  y ; do not install  redis,input n: " INSTALL_OR_NOT     case  $INSTALL _or_not in    y|y)          install_redis    ;;     n|n)         echo -e  "\e[0;44m <====stop  install  redis====> \e[0m"          exit 1    ;;     *)         echo -e  "\e[1;44m   only input  y or n  \e[0m "         install_or_not    ;;     esac}check_result () {    if [ $1 != 0 ]; then        echo -e  "\e[1,44m  <==== error , exit install redis ====> \e[0m "        exit  1    fi}install_redis () {[ ! -d ${soft_dir} ] &&  mkdir ${Soft_dir}cd ${Soft_dir}check_result  $?yum  install   Wget - ycheck_result  $?wget   $Download _urlcheck_result  $?tar xf redis-${redis_ Version}.tar.gzcheck_result  $?cd  redis-${redis_version}check_result  $? makecheck_result  $?make  installcheck_result  $?mkdir  -p /usr/ Local/redis/{etc,dump,logs}check_result  $?touch /usr/local/redis/etc/redis.confcheck_result   $?echo -e  "\e[1;44m <======please  configure redis.conf ==== ===> \e[0m "}root_or_notinstall_or_not~

This article from the "Do not ask for the best, only better" blog, please be sure to keep this source http://yujianglei.blog.51cto.com/7215578/1727884

Redis Automated Installation Scripts

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.