Update menu.sh

This commit is contained in:
MacRimi 2025-01-12 14:02:41 +01:00 committed by GitHub
parent 04f550e59a
commit 55b86cef75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

19
menu.sh
View File

@ -180,16 +180,18 @@ show_config_menu() {
show_menu() { show_menu() {
while true; do while true; do
if $USE_WHIPTAIL; then if $USE_WHIPTAIL; then
OPTION=$(whiptail --title "$MENU_TITLE" --menu "$SELECT_OPTION" 15 60 3 \ OPTION=$(whiptail --title "$MENU_TITLE" --menu "$SELECT_OPTION" 15 60 4 \
"1" "$OPTION_1" \ "1" "$OPTION_1" \
"2" "$OPTION_2" \ "2" "$OPTION_2" \
"3" "$OPTION_3" 3>&1 1>&2 2>&3) "3" "$OPTION_3" \
"4" "$EXIT_MENU" 3>&1 1>&2 2>&3)
else else
clear clear
echo -e "${YW}=== $MENU_TITLE ===${CL}" echo -e "${YW}=== $MENU_TITLE ===${CL}"
echo "1) $OPTION_2" echo "1) $OPTION_1"
echo "2) $OPTION_3" echo "2) $OPTION_2"
echo "q) $EXIT_MESSAGE" echo "3) $OPTION_3"
echo "q) $EXIT_MENU"
echo echo
read -p "$SELECT_OPTION " OPTION read -p "$SELECT_OPTION " OPTION
fi fi
@ -220,6 +222,12 @@ show_menu() {
3) 3)
show_config_menu show_config_menu
;; ;;
4)
if $USE_WHIPTAIL; then
msg_ok "$EXIT_MESSAGE"
exit 0
fi
;;
q|Q) q|Q)
if ! $USE_WHIPTAIL; then if ! $USE_WHIPTAIL; then
msg_ok "$EXIT_MESSAGE" msg_ok "$EXIT_MESSAGE"
@ -239,6 +247,7 @@ show_menu() {
done done
} }
# Verificar dependencias # Verificar dependencias
if ! command -v whiptail &> /dev/null; then if ! command -v whiptail &> /dev/null; then
msg_info "$DEPS_INSTALLING" msg_info "$DEPS_INSTALLING"