2018-08-23 16:48:03 +01:00
|
|
|
#!/bin/sh
|
|
|
|
set -euo pipefail
|
|
|
|
|
2018-09-07 20:46:08 +01:00
|
|
|
if [[ ! -f "${CONF_PATH}" ]]; then
|
|
|
|
./satellite setup
|
|
|
|
fi
|
|
|
|
|
|
|
|
RUN_PARAMS="${RUN_PARAMS:-} --config ${CONF_PATH}"
|
2018-08-23 16:48:03 +01:00
|
|
|
|
2018-09-07 20:46:08 +01:00
|
|
|
if [[ -n "${OVERLAY_URL:-}" ]]; then
|
|
|
|
RUN_PARAMS="${RUN_PARAMS} --overlay.database-url ${OVERLAY_URL}"
|
2018-08-23 16:48:03 +01:00
|
|
|
fi
|
|
|
|
|
2018-09-07 20:46:08 +01:00
|
|
|
RUN_PARAMS="${RUN_PARAMS} --identity.address=${IDENTITY_ADDR}"
|
|
|
|
|
2018-08-23 16:48:03 +01:00
|
|
|
if [[ -n "${API_KEY}" ]]; then
|
2018-09-12 16:02:53 +01:00
|
|
|
export STORJ_POINTER_DB_AUTH_API_KEY="${API_KEY}"
|
2018-08-23 16:48:03 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ -n "${BOOTSTRAP_ADDR:-}" ]]; then
|
|
|
|
RUN_PARAMS="${RUN_PARAMS} --kademlia.bootstrap-addr ${BOOTSTRAP_ADDR}"
|
|
|
|
fi
|
|
|
|
|
2018-09-07 20:46:08 +01:00
|
|
|
if [[ -n "${MOCK_OVERLAY_NODES:-}" ]]; then
|
|
|
|
RUN_PARAMS="${RUN_PARAMS} --mock-overlay.nodes ${MOCK_OVERLAY_NODES}"
|
|
|
|
fi
|
|
|
|
|
2018-08-23 16:48:03 +01:00
|
|
|
exec ./satellite run $RUN_PARAMS "$@"
|