Actualiser toolbox
This commit is contained in:
parent
81fd8f1d07
commit
81cda2f8a2
1 changed files with 11 additions and 4 deletions
15
toolbox
15
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
|
||||
whiptail --msgbox "Running: $CHOICE" 10 40
|
||||
"$SCRIPT_PATH"
|
||||
else
|
||||
whiptail --msgbox "No script selected." 10 40
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue