From 61fcf6fba96c07d7cdbacbbcca45f87576ea8163 Mon Sep 17 00:00:00 2001 From: Eddie Septr Date: Fri, 10 May 2019 06:03:31 +0700 Subject: [PATCH] Update Redis installer --- scripts/install_redis.sh | 44 ++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/scripts/install_redis.sh b/scripts/install_redis.sh index 477d013..690649c 100755 --- a/scripts/install_redis.sh +++ b/scripts/install_redis.sh @@ -1,11 +1,19 @@ #!/usr/bin/env bash +# Include decorator +if [ "$(type -t run)" != "function" ]; then + BASEDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd ) + . ${BASEDIR}/decorator.sh +fi + # Make sure only root can run this installer script if [ $(id -u) -ne 0 ]; then - echo "This script must be run as root..." + error "This script must be run as root..." exit 1 fi +echo -e "\nWelcome to Redis installation script" + function enable_redis { # Custom Redis setting cat >> /etc/redis/redis.conf < 0 ]]; then + status "Redis server started successfully." + else + warning "Something wrong with Redis installation." + fi fi