first commit
This commit is contained in:
28
files/entrypoint.sh
Executable file
28
files/entrypoint.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
log(){ echo "[netbox-reporter][entrypoint] $*"; }
|
||||
err(){ echo "[netbox-reporter][entrypoint][ERROR] $*" >&2; }
|
||||
|
||||
# Sanity: tools
|
||||
for bin in curl jq; do
|
||||
command -v "$bin" >/dev/null 2>&1 || { err "Missing $bin"; exit 2; }
|
||||
done
|
||||
|
||||
# Required env (all fed from .env via compose)
|
||||
: "${RMQ_USER:?RMQ_USER required}"
|
||||
: "${RMQ_PASS:?RMQ_PASS required}"
|
||||
: "${RMQ_HOST:?RMQ_HOST required}"
|
||||
: "${RMQ_PORT:?RMQ_PORT required}"
|
||||
: "${VHOST:?VHOST required}"
|
||||
: "${QUEUE:?QUEUE required}"
|
||||
: "${SLEEP_SECS:?SLEEP_SECS required}"
|
||||
|
||||
: "${NB_URL:?NB_URL required}"
|
||||
: "${NB_TOKEN:?NB_TOKEN required}"
|
||||
|
||||
log "RMQ=http://${RMQ_HOST}:${RMQ_PORT} vhost='${VHOST}' queue='${QUEUE}'"
|
||||
log "NB_URL=${NB_URL}"
|
||||
|
||||
# Hand off to main script
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user