__netbox: fix detection of the secret-key to use

Mixed up a parameter. Should be correct now.
This commit is contained in:
matze 2020-09-07 17:23:22 +02:00
parent eed3515424
commit 3389752dec

View file

@ -47,13 +47,13 @@ export ALLOWED_HOSTS
if [ -f "$__object/parameter/secret-key" ]; then if [ -f "$__object/parameter/secret-key" ]; then
SECRET_KEY=$(cat "$__object/parameter/secret-key") SECRET_KEY=$(cat "$__object/parameter/secret-key")
elif [ -s "$__object/explorer/secretkey" ]; then elif [ -s "$__object/explorer/secretkey" ]; then
# take the key that is already used
SECRET_KEY="$(cat "$__object/explorer/secretkey")"
else
# Can be done over netbox/generate_secret_key.py too, but it's to # Can be done over netbox/generate_secret_key.py too, but it's to
# complicated with the variable setup (can't generated right now!). # complicated with the variable setup (can't generated right now!).
# Generates a 50-character long key (without ' cause of python quotes) # Generates a 50-character long key (without ' cause of python quotes)
SECRET_KEY="$(tr -cd '[:graph:]' < /dev/random | tr -d \' | head -c50)" SECRET_KEY="$(tr -cd '[:graph:]' < /dev/random | tr -d \' | head -c50)"
else
# take the key that is already used
SECRET_KEY="$(cat "$__object/explorer/secretkey")"
fi fi
export SECRET_KEY export SECRET_KEY