Prevent failure due to -e flag used

Call get_ldap_base_dn to detect failure very early
diff --git a/image/service/slapd/startup.sh b/image/service/slapd/startup.sh
index c6d9d9b..0a56f0e 100755
--- a/image/service/slapd/startup.sh
+++ b/image/service/slapd/startup.sh
@@ -53,11 +53,13 @@
     fi
     # Check that LDAP_BASE_DN and LDAP_DOMAIN are in sync
     domain_from_base_dn=$(echo $LDAP_BASE_DN | tr ',' '\n' | sed -e 's/^.*=//' | tr '\n' '.' | sed -e 's/\.$//')
+    set +e
     echo "$domain_from_base_dn" | egrep -q ".*$LDAP_DOMAIN\$"
     if [ $? -ne 0 ]; then
       log-helper error "Error: domain $domain_from_base_dn derived from LDAP_BASE_DN $LDAP_BASE_DN does not match LDAP_DOMAIN $LDAP_DOMAIN"
       exit 1
     fi
+    set -e
   }
 
   function is_new_schema() {
@@ -102,6 +104,7 @@
     log-helper info "Database and config directory are empty..."
     log-helper info "Init new ldap server..."
 
+    get_ldap_base_dn
     cat <<EOF | debconf-set-selections
 slapd slapd/internal/generated_adminpw password ${LDAP_ADMIN_PASSWORD}
 slapd slapd/internal/adminpw password ${LDAP_ADMIN_PASSWORD}