From 7a4ae1190b6184e1b5c02acad994c2b4fc8a3f2c Mon Sep 17 00:00:00 2001 From: Christopher Date: Thu, 15 May 2025 15:47:56 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20add=20script=20to=20generat?= =?UTF-8?q?e=20file-browser-quantum=20config?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an interactive bash script that prompts the user for a config file location, checks for existing files, and downloads the default config.yml from the repository. Include a README with usage instructions. This simplifies setup by automating config retrieval and customization. --- .../README.md | 5 ++++ generate-file-browser-quantum-config/run.sh | 27 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 generate-file-browser-quantum-config/README.md create mode 100644 generate-file-browser-quantum-config/run.sh diff --git a/generate-file-browser-quantum-config/README.md b/generate-file-browser-quantum-config/README.md new file mode 100644 index 0000000..6191560 --- /dev/null +++ b/generate-file-browser-quantum-config/README.md @@ -0,0 +1,5 @@ +# Run command + +```bash +bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/generate-file-browser-quantum-config/run.sh)" +``` diff --git a/generate-file-browser-quantum-config/run.sh b/generate-file-browser-quantum-config/run.sh new file mode 100644 index 0000000..a1b5aae --- /dev/null +++ b/generate-file-browser-quantum-config/run.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Ask the user for the desired config location +read -p "Enter the location to save the config (default: /DATA/AppData/big-bear-file-browser-quantum/data/config.yml): " location + +# If the user doesn't provide a location, default to the specified path +if [ -z "$location" ]; then + location="/DATA/AppData/big-bear-file-browser-quantum/config.yml" +fi + +# Check if the config file already exists +if [ -e "$location" ]; then + read -p "Warning: $location already exists. Do you want to replace it? (yes/no) " replace + if [[ "$replace" != "yes" ]]; then + echo "Operation cancelled." + exit 1 + fi +fi + +# Create the directory (and its parents) if it doesn't exist +mkdir -p "$(dirname "$location")" + +# Download the file from the given URL and save it to the specified location +curl -L "https://raw.githubusercontent.com/bigbeartechworld/big-bear-casaos/refs/heads/master/Apps/file-browser-quantum/data/config.yml" -o "$location" + +# Confirm to the user +echo "Config saved to $location"