#!/usr/bin/env bash# Description: Interactively pulls and downloads an individual shell script from a specified folder within the remote GitHub repository, then makes it executable.# ConfigurationREPO_OWNER="77777kaz77777"REPO_NAME="linux-environment-automation"BRANCH="main"# Available folders identified from repository layoutVALID_FOLDERS=("configs""configs/setup-scripts""desktop-tweaks""maintenance""provisioning""security""security/clamav""security/hardening""security/network-tools""updates""utils")echo"Select a folder to pull from:"selectFOLDERin"${VALID_FOLDERS[@]}";doif[-n"$FOLDER"];thenbreakelseecho"Invalid selection. Please choose a valid number."fidoneread-rp"Enter the script name (e.g., create-script-template.sh): "SCRIPT
if[-z"$SCRIPT"];thenecho"Error: Script name cannot be empty."exit1fiRAW_URL="https://raw.githubusercontent.com/${REPO_OWNER}/${REPO_NAME}/${BRANCH}/${FOLDER}/${SCRIPT}"echo"Fetching ${SCRIPT} from ${FOLDER}..."curl-fLO"$RAW_URL"if[$?-eq0];thenecho"Successfully downloaded ${SCRIPT}"chmod+x"$SCRIPT"echo"Made ${SCRIPT} executable."elseecho"Error: Failed to download file. Please check the script name."exit1fi