From 23fb43ae2c8d1d68d88e41d42858069681436f69 Mon Sep 17 00:00:00 2001 From: Andriy Binetsky Date: Tue, 24 Jul 2018 11:33:52 +0200 Subject: [PATCH] ignore all the folders started with . (mostly tmp folders created by mounting) --- image/service/slapd/startup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/image/service/slapd/startup.sh b/image/service/slapd/startup.sh index 702d906..140f417 100755 --- a/image/service/slapd/startup.sh +++ b/image/service/slapd/startup.sh @@ -87,8 +87,8 @@ if [ ! -e "$FIRST_START_DONE" ]; then # database and config directory are empty # setup bootstrap config - Part 1 # - if [ -z "$(ls -A -I lost+found -I .rmtab -I .gitignore /var/lib/ldap)" ] && \ - [ -z "$(ls -A -I lost+found -I .rmtab -I .gitignore /etc/ldap/slapd.d)" ]; then + if [ -z "$(ls -A -I lost+found --ignore=.* /var/lib/ldap)" ] && \ + [ -z "$(ls -A -I lost+found --ignore=.* /etc/ldap/slapd.d)" ]; then BOOTSTRAP=true log-helper info "Database and config directory are empty..." @@ -133,14 +133,14 @@ EOF # # Error: the database directory (/var/lib/ldap) is empty but not the config directory (/etc/ldap/slapd.d) # - elif [ -z "$(ls -A -I lost+found -I .rmtab /var/lib/ldap)" ] && [ ! -z "$(ls -A -I lost+found -I .rmtab /etc/ldap/slapd.d)" ]; then + elif [ -z "$(ls -A -I lost+found --ignore=.* /var/lib/ldap)" ] && [ ! -z "$(ls -A -I lost+found --ignore=.* /etc/ldap/slapd.d)" ]; then log-helper error "Error: the database directory (/var/lib/ldap) is empty but not the config directory (/etc/ldap/slapd.d)" exit 1 # # Error: the config directory (/etc/ldap/slapd.d) is empty but not the database directory (/var/lib/ldap) # - elif [ ! -z "$(ls -A -I lost+found -I .rmtab /var/lib/ldap)" ] && [ -z "$(ls -A -I lost+found -I .rmtab /etc/ldap/slapd.d)" ]; then + elif [ ! -z "$(ls -A -I lost+found --ignore=.* /var/lib/ldap)" ] && [ -z "$(ls -A -I lost+found --ignore=.* /etc/ldap/slapd.d)" ]; then log-helper error "Error: the config directory (/etc/ldap/slapd.d) is empty but not the database directory (/var/lib/ldap)" exit 1