add conformation to delete an user
This commit is contained in:
parent
a1597fa7a8
commit
efea32e53c
@ -90,12 +90,18 @@ EOF
|
||||
#------------------------------------------------------------------------------
|
||||
# delUser
|
||||
function delUser {
|
||||
#echo $user_to_del
|
||||
ldapdelete -x -H $LDAP_SRV -D "$LDAP_MANAGER_USER" -w $LDAP_MANAGER_PASS \
|
||||
"cn=$user_to_del,ou=people,$LDAP_BASE"
|
||||
if [ "$?" == "0" ]; then
|
||||
echo "$user_to_del successfully deleted from directory"
|
||||
fi
|
||||
#echo $user_to_del
|
||||
# request confirmation
|
||||
echo -e "\nYou will DELETE 'cn=$user_to_del,ou=people,$LDAP_BASE' from the directory"
|
||||
read -p "Are you sure? " -n 1 -r
|
||||
echo -e "\n"
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
ldapdelete -x -H $LDAP_SRV -D "$LDAP_MANAGER_USER" -w $LDAP_MANAGER_PASS \
|
||||
"cn=$user_to_del,ou=people,$LDAP_BASE"
|
||||
if [ "$?" == "0" ]; then
|
||||
echo "$user_to_del successfully deleted from directory"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
#------------------------------------------------------------------------------
|
||||
# main
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user