Is there a way to do one of the following in an LDIF file?
- Ignore error (attr not found) when trying to delete an attribute
Or:
- If attribute exists, modify it
- If it doesn't exist, add it
Is there a way to do one of the following in an LDIF file?
Or:
The right way to do this is simply using the replace action
dn: ...
changetype: modify
replace: attributeName
attributeName: xxx
ldapmodify
has a -c
flag:
-c continuous operation mode (do not stop on errors)
... which I guess should take care of your first point.
dn: ...
changetype: modify
add: attributeName
attributeName: xxx
-
delete: attributeName
attributeName: value
-
delete: attributeOther
May also work for you. This allows multiple operations while listing the DN once.