Redis:1、自动化安装Shell脚本

#!/bin/bash

#zhouyihua

#v0.2

#2021-08-12

# set work dir

cd /opt

echo nameserver 8.8.8.8 > /etc/resolv.conf

rpm -qa | grep wget

if [ $?  != "0" ] ; then

    yum -y install wget

else

  echo "wget already exist"

fi

wget http://download.redis.io/releases/redis-5.0.0.tar.gz

tar -zxvf /opt/redis-5.0.0.tar.gz

cd /opt/redis-5.0.0

rpm -qa | grep make

if [ $? != "0" ]; then

        yum -y install gcc automake autoconf libtool make

else

  echo "make already exist"

fi

make

sed -i 's/daemonize no/daemonize yes/' /opt/redis-5.0.0/redis.conf

sed -i 's/# requirepass foobared/requirepass 123456/' /opt/redis-5.0.0/redis.conf

/opt/redis-5.0.0/src/redis-server  /opt/redis-5.0.0//redis.conf  &

echo "redis install & config success!!!"

rm -rf /opt/redis-5.0.0.tar.gz

exit

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容