Add 'install-Redis.sh'
A version with apt installer, menu and questions.
This commit is contained in:
100
install-Redis.sh
Normal file
100
install-Redis.sh
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
###============================================================
|
||||||
|
## Ubuntu 18.04 Reddis Installer
|
||||||
|
###============================================================
|
||||||
|
## Zet comments hieronder:
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
##=============================================================
|
||||||
|
|
||||||
|
##----------##
|
||||||
|
# Menu #
|
||||||
|
##----------##
|
||||||
|
|
||||||
|
echo "Ubuntu 18.04 Reddis installatie script."
|
||||||
|
echo "Installatiemethode?"
|
||||||
|
PS3='Keuze:'
|
||||||
|
options=("apt" "Compile 64-Bit" "Compile 32-Bit" "Quit")
|
||||||
|
select opt in "${options[@]}"
|
||||||
|
do
|
||||||
|
case $opt in
|
||||||
|
"Compile 32-Bit")
|
||||||
|
rcomp=c32
|
||||||
|
break;;
|
||||||
|
"apt")
|
||||||
|
rcomp=apt
|
||||||
|
break;;
|
||||||
|
"Compile 64-Bit")
|
||||||
|
rcomp=c64
|
||||||
|
break;;
|
||||||
|
"Quit")
|
||||||
|
exit;;
|
||||||
|
*) echo "Fout commando $REPLY";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
read -p "Wiltu predis instaleren? -> ja/nee?" yn
|
||||||
|
case $yn in
|
||||||
|
[JjYy]* ) predis=1
|
||||||
|
break;;
|
||||||
|
[Nn]* ) predis=0
|
||||||
|
break;;
|
||||||
|
* ) echo "Kies ja of nee.";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
##-------------------##
|
||||||
|
# Apt installer #
|
||||||
|
##-------------------##
|
||||||
|
|
||||||
|
if [ "$rcomp" == 'apt' ]; then
|
||||||
|
apt install -y redis-server
|
||||||
|
sed -i 's/supervised no/supervised systemd/g' /etc/redis/redis.conf
|
||||||
|
sed -i 's/# bind 127.0.0.1 ::1/bind 127.0.0.1 ::1/g' /etc/redis/redis.conf
|
||||||
|
sed -i 's/# requirepass foobared/# requirepass '$password'/g' /etc/redis/redis.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##--------------------------------##
|
||||||
|
# Common redis build funtion #
|
||||||
|
##--------------------------------##
|
||||||
|
|
||||||
|
function redis_common {
|
||||||
|
echo "redis_common functie"
|
||||||
|
}
|
||||||
|
|
||||||
|
##---------------------##
|
||||||
|
# Build installer #
|
||||||
|
##---------------------##
|
||||||
|
|
||||||
|
if [ "$rcomp" == 'c32' ]; then
|
||||||
|
redis_common
|
||||||
|
echo "morehere"
|
||||||
|
#sed -i 's/supervised no/supervised systemd/g' /etc/redis/redis.conf
|
||||||
|
#sed -i 's/# bind 127.0.0.1 ::1/bind 127.0.0.1 ::1/g' /etc/redis/redis.conf
|
||||||
|
#sed -i 's/# requirepass foobared/# requirepass '$password'/g' /etc/redis/redis.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$rcomp" == 'c64' ]; then
|
||||||
|
redis_common
|
||||||
|
echo "morehere"
|
||||||
|
#sed -i 's/supervised no/supervised systemd/g' /etc/redis/redis.conf
|
||||||
|
#sed -i 's/# bind 127.0.0.1 ::1/bind 127.0.0.1 ::1/g' /etc/redis/redis.conf
|
||||||
|
#sed -i 's/# requirepass foobared/# requirepass '$password'/g' /etc/redis/redis.conf
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
##------------##
|
||||||
|
# Predis #
|
||||||
|
##------------##
|
||||||
|
|
||||||
|
if [ $predis = 1 ]; then
|
||||||
|
echo "This feature wil implemented later"
|
||||||
|
#git clone https://github.com/phpredis/phpredis.git /opt/phpredis
|
||||||
|
#apt install -y php${phpver}-dev
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user