#!/bin/sh -e

. shell-error
. /etc/cl-user.conf

[ "$#" -eq 1 ] || fatal "more arguments required"
user="$1"; shift

[ -n "$bindpw" ] && bindpw="-w $bindpw" || bindpw="-W"

#edit ldap
(echo "dn: uid=$user,ou=People,$base"
while read line; do
	echo $line
done ) |
ldapmodify -D "$binddn" $bindpw -x -H "ldap://${host:-localhost}"
