From 81cda2f8a2e81d3b46bbcd1deca75e3105085a16 Mon Sep 17 00:00:00 2001 From: TyleoDvDelaware3217 Date: Thu, 29 May 2025 03:05:15 +0200 Subject: [PATCH] Actualiser toolbox --- toolbox | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/toolbox b/toolbox index 23742ba..aa61a48 100644 --- a/toolbox +++ b/toolbox @@ -25,9 +25,12 @@ declare -A SCRIPT_MAP for script in "${SCRIPTS[@]}"; do # Get base name, remove underscores, and capitalize first letter DISPLAY_NAME=$(basename "$script" | sed 's/_/ /g' | awk '{print toupper(substr($0,1,1)) tolower(substr($0,2))}') - - MENU_OPTIONS+=("$DISPLAY_NAME" "") - SCRIPT_MAP["$DISPLAY_NAME"]="$script" + + # Exclude scripts with "Toolbox" in the name + if [[ "$DISPLAY_NAME" != *"Toolbox"* ]]; then + MENU_OPTIONS+=("$DISPLAY_NAME" "") + SCRIPT_MAP["$DISPLAY_NAME"]="$script" + fi done # Show the menu using whiptail @@ -36,4 +39,8 @@ CHOICE=$(whiptail --title "Script Selector" --menu "Choose a script to run:" 15 # Check if the user made a selection if [[ -n "$CHOICE" ]]; then SCRIPT_PATH="${SCRIPT_MAP[$CHOICE]}" - whiptail --msgbox "Running: $CHOICE \ No newline at end of file + whiptail --msgbox "Running: $CHOICE" 10 40 + "$SCRIPT_PATH" +else + whiptail --msgbox "No script selected." 10 40 +fi