[fix] Hide cat error if tmp_backup_dir_file doesn't exist in conf_regen

This commit is contained in:
Jérôme Lebleu 2016-05-21 21:22:51 +02:00
parent f09ab43eb8
commit 53573e50dc

View file

@ -82,7 +82,7 @@ do_post_regen() {
sudo slaptest -Q -u -f /etc/ldap/slapd.conf sudo slaptest -Q -u -f /etc/ldap/slapd.conf
# check if a backup should be restored # check if a backup should be restored
backup_dir=$(cat "$tmp_backup_dir_file" || true) backup_dir=$(cat "$tmp_backup_dir_file" 2>/dev/null || true)
if [[ -n "$backup_dir" && -f "${backup_dir}/dc=yunohost-dc=org.ldif" ]]; then if [[ -n "$backup_dir" && -f "${backup_dir}/dc=yunohost-dc=org.ldif" ]]; then
# regenerate LDAP config directory and import database as root # regenerate LDAP config directory and import database as root
# since the admin user may be unavailable # since the admin user may be unavailable