Crysalix/main.sh
TheHackdes ea960e5320 feat(main.sh): add functionality to add users to a group
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.
2026-05-04 20:41:53 +02:00

30 lines
583 B
Bash
Executable file
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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