Files
Docker-Chevereto/scripts/system/namespace.sh
Rodolfo Berrios b85ee989e5 remove default ns
2024-02-09 14:13:16 -03:00

17 lines
408 B
Bash
Executable File

#!/usr/bin/env bash
set -e
if [ -f "${NAMESPACE_FILE}" ]; then
echo "[!] File ${NAMESPACE_FILE} already exists"
exit 1
fi
if [ "${ENCRYPTION_KEY}" == "" ]; then
ENCRYPTION_KEY=$(openssl rand -base64 32)
echo '🔑 Using auto encryption key'
fi
mkdir -p $(dirname ${NAMESPACE_FILE})
cat >${NAMESPACE_FILE} <<EOM
HOSTNAME=${HOSTNAME}
ENCRYPTION_KEY=${ENCRYPTION_KEY}
EOM
echo ${NAMESPACE_FILE}