#!/bin/bash

# Return Redis password

set -o nounset -o pipefail -o errexit

redis_conf="${1:-/etc/redis/redis.conf}"

if [ -r "${redis_conf}" ] ; then
    grep -E '^masterauth' "${redis_conf}" | awk '{print $2}' | sed -e 's/^"//' -e 's/"$//'
fi
