This commit introduces the ability to add one or more users to a group using the main script. The user is prompted to select this option from the menu, and if chosen, the action/add\_user\_to\_group.sh script is sourced to perform the operation. If an unrecognized choice is made, an error message is displayed and the script exits with a status of 1.
30 lines
583 B
Bash
Executable file
30 lines
583 B
Bash
Executable file
#!/bin/bash
|
||
|
||
source ./sources/functions.sh
|
||
|
||
banner "Manage OpenLDAP"
|
||
|
||
CHOIX=(
|
||
"1. Ajouter un ou plusieurs utilisateurs a un groupe"
|
||
)
|
||
|
||
select_option() {
|
||
choice=$(printf "%s\n" "${CHOIX[@]}" | fzf --height=4 --reverse --cycle --prompt="❯ Choix : " --layout=reverse)
|
||
log info "Selection - ${choice}"
|
||
}
|
||
|
||
sleep 1.5
|
||
|
||
select_option
|
||
|
||
case $choice in
|
||
"1. Ajouter un ou plusieurs utilisateurs a un groupe")
|
||
log success "Ajouter un ou plusieurs utilisateurs a un groupe"
|
||
sleep 1
|
||
source ./actions/add_user_to_group·sh
|
||
;;
|
||
*)
|
||
log error "Choice non reconnue"
|
||
exit 1
|
||
;;
|
||
esac
|