yunohost/data/hooks/backup/05-conf_ldap
Josué Tille f22f64103a Backup/restore also slapd.ldif
We need this because the regen-conf need to get the state of the slapd config database if it is customized or not and if some update are need.
2020-07-27 19:26:18 +02:00

18 lines
484 B
Bash
Executable file

#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
source /usr/share/yunohost/helpers
# Backup destination
backup_dir="${1}/conf/ldap"
# Backup the configuration
ynh_backup "/etc/ldap/ldap.conf" "${backup_dir}/ldap.conf"
ynh_backup "/etc/ldap/slapd.ldif" "${backup_dir}/slapd.ldif"
slapcat -b cn=config -l "${backup_dir}/cn=config.master.ldif"
# Backup the database
slapcat -b dc=yunohost,dc=org -l "${backup_dir}/dc=yunohost-dc=org.ldif"