#!/bin/sh
#
set -e -u
LB=$(ucr get ldap/base)
ldapmodify -Y EXTERNAL -H ldapi:/// <<__LDIF__
dn: cn=test,$LB
changetype: add
objectClass: person
cn: test
sn: test
__LDIF__
ldapsearch -LLLo ldif-wrap=no -Y EXTERNAL -H ldapi:/// -b "cn=test,$LB" -s base objectClas structuralObjectClass
ldapmodify -Y EXTERNAL -H ldapi:/// -e relax <<__LDIF__
dn: cn=test,$LB
changetype: modify
add: objectClass
objectClass: organizationalPerson
objectClass: inetOrgPerson
-
add: displayName
displayName: Test
__LDIF__
ldapsearch -LLLo ldif-wrap=no -Y EXTERNAL -H ldapi:/// -b "cn=test,$LB" -s base objectClas structuralObjectClass