From df1ff0d8d40dbda4505efc64127801e80185452c Mon Sep 17 00:00:00 2001 From: bprieshof Date: Fri, 14 Jun 2019 14:17:00 +0200 Subject: [PATCH] Add 'install-Redis.sh' A version with apt installer, menu and questions. --- install-Redis.sh | 100 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 install-Redis.sh diff --git a/install-Redis.sh b/install-Redis.sh new file mode 100644 index 0000000..714492d --- /dev/null +++ b/install-Redis.sh @@ -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