#!/bin/sh -e

# This is documented here:
# https://docs.openshift.com/container-platform/3.11/creating_images/guidelines.html#openshift-specific-guidelines

if ! whoami &>/dev/null; then
  if [ -w /etc/passwd ]; then
    echo "${USER_NAME:-redisgraph}:x:$(id -u):$(id -g):${USER_NAME:-redisgraph} user:${HOME}:/sbin/nologin" >> /etc/passwd
  fi
fi


if [ -z "$REDIS_GRAPH_SSL" ]; then
  echo Starting RedisGraph UNSECURED. 
  sh start-redis-process.sh
else
  echo Starting RedisGraph with SSL.
  honcho start
fi