From 14db4d33989a92066e0f11a914a432e3e58a8f24 Mon Sep 17 00:00:00 2001 From: Scott Wallace Date: Tue, 29 Mar 2022 18:58:44 +0100 Subject: [PATCH] Make the entrypoint.sh more generic --- docker-entrypoint.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index c46e073..1842504 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -3,15 +3,19 @@ ARCH=$(uname -m) BIN_DIR=/app/linux-${ARCH} DATA_DIR=/etc/nebula +HOSTNAME=$(hostname) + +if test -z "${NEBULA_IP}"; then + echo "You did not set a value for the environment variable NEBULA_IP" + exit 2 +fi # --------------------- TESTING ONLY ------------------------ # Build certs if they don't exist if ! test -f ${DATA_DIR}/ca.key; then cd ${DATA_DIR} || exit 1 "${BIN_DIR}/nebula-cert" ca -name "Infranet" - "${BIN_DIR}/nebula-cert" sign -name "lighthouse" -ip "10.10.100.1/24" - mv lighthouse.crt host.crt - mv lighthouse.key host.key + "${BIN_DIR}/nebula-cert" sign -name "${HOSTNAME}" -ip "${NEBULA_IP}" -out-key host.key -out-crt host.crt fi # -----------------------------------------------------------