infranet/docker-entrypoint.sh

24 lines
693 B
Bash
Raw Normal View History

2022-03-29 10:14:59 +01:00
#!/bin/sh
2022-03-29 18:50:48 +01:00
ARCH=$(uname -m)
BIN_DIR=/app/linux-${ARCH}
DATA_DIR=/etc/nebula
2022-03-29 18:58:44 +01:00
HOSTNAME=$(hostname)
if test -z "${NEBULA_IP}"; then
echo "You did not set a value for the environment variable NEBULA_IP"
exit 2
fi
2022-03-29 18:50:48 +01:00
# --------------------- 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"
2022-03-29 18:58:44 +01:00
"${BIN_DIR}/nebula-cert" sign -name "${HOSTNAME}" -ip "${NEBULA_IP}" -out-key host.key -out-crt host.crt
2022-03-29 18:50:48 +01:00
fi
# -----------------------------------------------------------
2022-03-29 10:14:59 +01:00
# Run the platform-specific binary
2022-03-29 18:50:48 +01:00
"${BIN_DIR}/nebula" -config ${DATA_DIR}/config.yaml