#!/bin/sh

if [ "$1" = "-h" ]; then
  echo "Usage: `basename $0` -u [admin username] -p [admin password]"
  exit 0
fi

if [ -z "$1" ]; then
  echo "Usage: `basename $0` -u [admin username] -p [admin password]"
  exit 1
fi

if [ -z "$2" ]; then
  echo "Usage: `basename $0` -u [admin username] -p [admin password]"
  exit 1
fi


while getopts u:p:d: flag
do
    case "${flag}" in
        u) user=${OPTARG};;
        p) pass=${OPTARG};;
    esac
done

export KC_BOOTSTRAP_ADMIN_USERNAME=$user
export KC_BOOTSTRAP_ADMIN_PASSWORD=$pass

`dirname $0`/run-keycloak.sh