yunohost/hooks/backup/05-conf_ldap
2021-11-10 17:56:02 +01:00

17 lines
423 B
Bash

#!/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"
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"