__netbox: no ldap config if no ldap parameters

The ldap config file will be empty (only comments) if no parameter
name set matches `^ldap-*`.

It still generate a ldap config if one or more ldap parameters are set,
but not all basic parameters.
This commit is contained in:
matze 2020-08-20 17:53:25 +02:00
parent e47cead637
commit 0281b2c804

View file

@ -1,5 +1,19 @@
#!/bin/sh
# no configuration if there are no ldap parameters
if ls -1qA "$__object/parameter"/ldap-* | grep -q .; then
# skip
cat << EOF
##############################
# LDAP-backed authentication #
##############################
# no options set
EOF
exit 0
fi
cat << EOF
##############################
# LDAP-backed authentication #