[fix] regenconf: fix a stupid issue with slapcat displaying an error message because grep -q breaks the pipe

This commit is contained in:
Alexandre Aubin 2022-08-30 00:04:23 +02:00
parent c0ceb66ad4
commit 503b90316f

View file

@ -139,7 +139,7 @@ do_post_regen() {
fi
# For some reason, old setups don't have the admins group defined...
if ! slapcat | grep -q 'cn=admins,ou=groups,dc=yunohost,dc=org'; then
if ! slapcat -H "ldap:///cn=admins,ou=groups,dc=yunohost,dc=org" | grep -q 'cn=admins,ou=groups,dc=yunohost,dc=org'; then
slapadd -F /etc/ldap/slapd.d -b dc=yunohost,dc=org <<< \
"dn: cn=admins,ou=groups,dc=yunohost,dc=org
cn: admins