70 lines
2.8 KiB
Bash
70 lines
2.8 KiB
Bash
#!/bin/bash
|
|
|
|
# --- Configuration ---
|
|
# Define script packages. The key is the name that will appear in the menu.
|
|
# The value is a space-separated string of all the URLs to download for that package.
|
|
declare -A SCRIPT_PACKAGES
|
|
|
|
SCRIPT_PACKAGES["Aurora Suite"]="https://git.technopunk.space/tomi/Scripts/raw/branch/main/aurora/aurora.sh https://git.technopunk.space/tomi/Scripts/raw/branch/main/aurora/aurora.conf"
|
|
SCRIPT_PACKAGES["Userstore Key Manager"]="https://git.technopunk.space/tomi/Scripts/raw/branch/main/hdb_keymanager.sh"
|
|
# Example: To add another single script later, just add a new line:
|
|
# SCRIPT_PACKAGES["My Other Script"]="https://path/to/my-other-script.sh"
|
|
|
|
|
|
# --- Main Script ---
|
|
|
|
# Welcome message
|
|
echo "-------------------------------------"
|
|
echo " Script Downloader "
|
|
echo "-------------------------------------"
|
|
|
|
# Create an array of options from the package names (the keys of our map)
|
|
options=("${!SCRIPT_PACKAGES[@]}")
|
|
options+=("Quit") # Add a Quit option
|
|
|
|
# Set the prompt for the select menu
|
|
PS3="Please enter the number of the script/package you want to download: "
|
|
|
|
# Display the menu and handle user input
|
|
select choice in "${options[@]}"; do
|
|
case "${choice}" in
|
|
"Quit")
|
|
echo "👋 Exiting."
|
|
break
|
|
;;
|
|
*)
|
|
# Check if the user's choice is a valid package name
|
|
if [[ -n "${SCRIPT_PACKAGES[$choice]}" ]]; then
|
|
echo
|
|
echo "⬇️ Downloading package: '${choice}'..."
|
|
|
|
# Get the space-separated list of URLs for the chosen package
|
|
urls_to_download="${SCRIPT_PACKAGES[$choice]}"
|
|
|
|
# Loop through each URL in the list and download the file
|
|
for url in $urls_to_download; do
|
|
filename=$(basename "${url}")
|
|
echo " -> Downloading '${filename}'..."
|
|
|
|
# Use curl to download the file
|
|
if curl -fsSL -o "${filename}" "${url}"; then
|
|
echo " ✅ Successfully downloaded '${filename}'."
|
|
# If the downloaded file is a shell script, make it executable
|
|
if [[ "${filename}" == *.sh ]]; then
|
|
chmod +x "${filename}"
|
|
echo " 🤖 Made '${filename}' executable."
|
|
fi
|
|
else
|
|
echo " ❌ Error: Failed to download '${filename}'."
|
|
fi
|
|
done
|
|
echo
|
|
echo "📦 Package download complete."
|
|
break
|
|
else
|
|
# The user entered an invalid number
|
|
echo "Invalid selection. Please try again."
|
|
fi
|
|
;;
|
|
esac
|
|
done |