View Single Post
Old 7th May 2012, 08:56
nbhadauria nbhadauria is offline
Join Date: Aug 2010
Location: New Delhi, India
Posts: 79
Thanks: 1
Thanked 13 Times in 13 Posts
Send a message via Skype™ to nbhadauria

You can use sed command to append the config into file:

sed -i '/^SEARCHPATTERN/ a\
access to attrs=userPassword\
by self write\
by anonymous auth\
by dn.base="cn=root,dc=abclott,dc=lott" write\
by group.base="cn=infrastructure,ou=GTECH,ou=groups,d c=abclott,dc=lott" write\
by dn.base="uid=ldapmgr,ou=people,dc=abclott,dc=lott" write\
by * none' /etc/ldap/slapd.conf

Or even you can insert config.txt file in the config:

sed -i '/^SEARCHPATTERN/r config.txt' /etc/ldap/slapd.conf
Nitin Bhadauria
Reply With Quote