From 55b5f93ef4cf068cca2bd8a736e00aad7641655f Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 10 Dec 2020 02:52:56 +0100 Subject: [PATCH] Fix Redis for dispatcher --- rootfs/etc/cont-init.d/05-svc-dispatcher.sh | 24 ++++++++++----------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/rootfs/etc/cont-init.d/05-svc-dispatcher.sh b/rootfs/etc/cont-init.d/05-svc-dispatcher.sh index dcd3d9a..94a4b02 100644 --- a/rootfs/etc/cont-init.d/05-svc-dispatcher.sh +++ b/rootfs/etc/cont-init.d/05-svc-dispatcher.sh @@ -87,25 +87,23 @@ if [ -n "$DISPATCHER_NODE_ID" ]; then sed -i "s|^NODE_ID=.*|NODE_ID=$DISPATCHER_NODE_ID|g" "${LIBRENMS_PATH}/.env" fi -# Redis Sentinel -if [ -n "$REDIS_SENTINEL" ]; then - echo "Setting Redis Sentinel" +# Redis +if [ -z "$REDIS_HOST" ] && [ -z "$REDIS_SENTINEL" ]; then + >&2 echo "ERROR: REDIS_HOST or REDIS_SENTINEL must be defined" + exit 1 +elif [ -n "$REDIS_HOST" ]; then +echo "Setting Redis" cat >> ${LIBRENMS_PATH}/.env <&2 echo "ERROR: REDIS_HOST or REDIS_SENTINEL must be defined" - exit 1 - fi - echo "Setting Redis" +elif [ -n "$REDIS_SENTINEL" ]; then +echo "Setting Redis Sentinel" cat >> ${LIBRENMS_PATH}/.env <