#!/bin/bash uid="$1" if [ -z "$uid" ]; then echo "Need a user ID (uid)!" exit 1 fi read -sp 'cn=root,dc=aninix,dc=net Password: ' rootdnpw ldappasswd -D 'cn=root,dc=aninix,dc=net' -w "$rootdnpw" -H ldap://127.0.0.1 "uid=$uid,ou=People,dc=aninix,dc=net" && \ ldapmodify -D 'cn=root,dc=aninix,dc=net' -w "$rootdnpw" -H ldap://127.0.0.1 -f <(cat <