#!/bin/bash

# Errors and logz
set -e

# Detect and run the correct entrypoint script. THANKS BITNAMI!
if [ -f "/opt/bitnami/scripts/mongodb/entrypoint.sh" ]; then
  /opt/bitnami/scripts/mongodb/entrypoint.sh /opt/bitnami/scripts/mongodb/run.sh
elif [ -f "/app-entrypoint.sh" ]; then
  /app-entrypoint.sh /run.sh
else
  /entrypoint.sh /run.sh
fi
