From 5f09b5fd2c218b8a37a9c8ec64b5eb68d8f15c24 Mon Sep 17 00:00:00 2001 From: Bryan Joshua Pedini Date: Sat, 24 Sep 2022 12:27:01 +0200 Subject: [PATCH] added post-installation directives --- post-installation.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 post-installation.sh diff --git a/post-installation.sh b/post-installation.sh new file mode 100755 index 0000000..a1f3501 --- /dev/null +++ b/post-installation.sh @@ -0,0 +1,14 @@ +#/usr/bin/env bash +set -e + +# Search or ask for .env file +ENV_FILE=".env" +while [ ! -f "${ENV_FILE}" ]; do + read -p "\"${ENV_FILE}\" file does not exist, please type your env file: " ENV_FILE +done + +# Disable superuser config in environment variable, it's now in the database +sed -i "s/NETBOX_SUPERUSER_EMAIL=.*/NETBOX_SUPERUSER_EMAIL=/" "${ENV_FILE}" +sed -i "s/NETBOX_SUPERUSER_NAME=.*/NETBOX_SUPERUSER_NAME=/" "${ENV_FILE}" +sed -i "s/NETBOX_SUPERUSER_PASS=.*/NETBOX_SUPERUSER_PASS=/" "${ENV_FILE}" +sed -i "s/NETBOX_SKIP_SUPERUSER=/NETBOX_SKIP_SUPERUSER=true/" "${ENV_FILE}"