Use ldapadd instead of slapadd.

This commit is contained in:
James Valleroy authored and Sunil Mohan Adapa committed 2015-06-12 15:49:41 +05:30
1 parent b2cd67c78b
commit aece3d7ee0
1 file changed
+6 -3
+6 -3
View File
@@ -19,8 +19,7 @@
username="$1"
password="$2"
service slapd stop
cat <<EOF |slapadd
cat <<EOF |ldapadd -x -D 'cn=admin,dc=thisbox' -w $(cat /var/lib/plinth/ldap-admin)
dn: uid=$username,ou=users,dc=thisbox
objectClass: inetOrgPerson
uid: $username
@@ -28,4 +27,8 @@ sn: $username
cn: $username
userPassword: $password
EOF
service slapd start
if [ $? -ne 0 ]; then
echo "Failed to create user"
exit 1
fi