| 123456789101112131415161718192021222324 |
- #!/bin/bash
- . .env
- . funcs
- uid=$1
- if user_exists $uid; then
- true
- else
- echo "User $uid does not exist."
- exit 1
- fi
- read -p "Are you sure you want to delete user $uid [y/N] " a
- case $a in
- y*|o* )
- if user_is_posix $uid; then
- ldapdelete $LDAPOPTS cn=$uid,$GROUPSDN
- ./removefromgroups $uid $(get_posixGroups $uid)
- fi
- ldapdelete $LDAPOPTS uid=$uid,$PEOPLEDN ;;
- * )
- exit;;
- esac
|