diff --git a/netbox/install.sh b/netbox/install.sh index d04e029..4f676d6 100644 --- a/netbox/install.sh +++ b/netbox/install.sh @@ -19,7 +19,7 @@ echo "Checking Python version. Please ensure this meets the minimum requirements python3 --version # Prompt user to confirm if the currently installed Python version meets the minimum requirements -read -p "Does the installed Python version meet the minimum requirements? (y/n): " PYTHON_CONFIRM +read -p "Does the installed Python version meet the minimum requirements of Python 3.8, 3.9, 3.10 or 3.11.? (y/n): " PYTHON_CONFIRM if [[ $PYTHON_CONFIRM != "y" ]]; then echo "Please install the required version of Python and rerun this script." exit 1 @@ -61,10 +61,14 @@ sed -i "s/'NAME': '',/'NAME': 'netbox',/g" configuration.py sed -i "s/'PASSWORD': '',/'PASSWORD': '$PG_PASSWORD',/g" configuration.py sed -i "s/'HOST': '',/'HOST': 'localhost',/g" configuration.py -# Prompt user to enter ALLOWED_HOSTS, REDIS, and SECRET_KEY +# Generate secret key and parse it into configuration.py +echo "Generating secret key..." +SECRET_KEY=$(python3 /opt/netbox/generate_secret_key.py) +sed -i "s/SECRET_KEY = ''/SECRET_KEY = '$SECRET_KEY'/g" configuration.py + +# Prompt user to enter ALLOWED_HOSTS echo "Please enter manually input the following inforation..." read -p "Enter ALLOWED_HOSTS (separated by commas): " ALLOWED_HOSTS -read -p "Enter SECRET_KEY: " SECRET_KEY # Parse user input into configuration.py echo "Parsing the entered information to configuration.py..."