#!/bin/sh

echo "Running registrar" >&2
replace=""
if test "$REGISTRAR_REPLACE" = true; then
    replace="--replace"
fi

registrar daemon \
    --config-file /config.yaml \
    --host ${REDIS_HOST} \
    --port ${REDIS_PORT} \
    --listen-queue ${REDIS_REGISTER_QUEUE_KEY} \
    --progress-set ${REDIS_REGISTER_PROGRESS_KEY} \
    --failure-set ${REDIS_REGISTER_FAILURE_KEY} \
    --success-set ${REDIS_REGISTER_SUCCESS_KEY} \
    ${replace} >&2
