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

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容