mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Rely on conf file for current backend and create slapd.d
This commit is contained in:
parent
78ceefd06a
commit
598cb11a98
1 changed files with 4 additions and 2 deletions
|
@ -46,8 +46,7 @@ do_pre_regen() {
|
|||
sudo rm -f "$tmp_backup_dir_file"
|
||||
|
||||
# retrieve current and new backends
|
||||
curr_backend=$(sudo slapcat -n 0 \
|
||||
| sed -n 's/^dn: olcDatabase={1}\(.*\),cn=config$/\1/p')
|
||||
curr_backend=$(grep '^database' /etc/ldap/slapd.conf | awk '{print $2}')
|
||||
new_backend=$(grep '^database' slapd.conf | awk '{print $2}')
|
||||
|
||||
# save current database before any conf changes
|
||||
|
@ -69,6 +68,9 @@ do_pre_regen() {
|
|||
do_post_regen() {
|
||||
regen_conf_files=$1
|
||||
|
||||
# ensure that slapd.d exists
|
||||
sudo mkdir -p /etc/ldap/slapd.d
|
||||
|
||||
# fix some permissions
|
||||
sudo chown root:openldap /etc/ldap/slapd.conf
|
||||
sudo chown -R openldap:openldap /etc/ldap/schema/
|
||||
|
|
Loading…
Add table
Reference in a new issue