diff --git a/.check/ShellCheck.py b/.check/ShellCheck.py index 50a20f1..07d8ddc 100644 --- a/.check/ShellCheck.py +++ b/.check/ShellCheck.py @@ -1,5 +1,7 @@ #!/usr/bin/env python3 +# Requires Shellcheck: https://github.com/koalaman/shellcheck#user-content-installing + import os import sys import subprocess @@ -23,7 +25,7 @@ def run_shellcheck(file_path): Returns stdout, stderr, and the process return code. """ result = subprocess.run( - ["shellcheck", file_path], + ["shellcheck", "-e", "SC1090", file_path], capture_output=True, text=True ) @@ -74,7 +76,7 @@ def main(): # For each .sh file, either use ShellCheck or fallback checks for sh_file in sh_files: - print(f"\n=== Checking file: {sh_file} ===") + print(f"=== Checking file: {sh_file} ===") if shellcheck_installed: # Run ShellCheck @@ -95,8 +97,6 @@ def main(): print("Naive check found potential issues:") for err in errors: print(f" - {err}") - else: - print("Naive check: no issues found.") if __name__ == "__main__": main() diff --git a/CCPVE.sh b/CCPVE.sh index 8d6a4c1..eab25ce 100644 --- a/CCPVE.sh +++ b/CCPVE.sh @@ -6,7 +6,7 @@ # in the repository executable and finally call CCPVEOffline.sh. # # Usage: -# ./CCPVE.sh +# ./CCPVE.sh [-nh] # # This script requires 'unzip' and 'wget'. If not installed, it will prompt to install them. # @@ -16,6 +16,23 @@ set -e +apt update || true + +SHOW_HEADER="true" + +while [[ $# -gt 0 ]]; do + case "$1" in + -nh) + SHOW_HEADER="false" + shift + ;; + *) + echo "Error: Unknown argument '$1'" + exit 1 + ;; + esac +done + # --- Check Dependencies ----------------------------------------------------- if ! command -v unzip &>/dev/null; then echo "The 'unzip' utility is required to extract the downloaded files but is not installed." @@ -77,12 +94,16 @@ else echo "Warning: MakeScriptsExecutable.sh not found. Skipping." fi -# --- Call CCPVEOffline.sh -------------------------------------------------- -if [ -f "./CCPVEOffline.sh" ]; then - echo "Calling CCPVEOffline.sh..." - bash "./CCPVEOffline.sh" +# --- Call GUI.sh -------------------------------------------------- +if [ -f "./GUI.sh" ]; then + echo "Calling GUI.sh..." + if [ "$SHOW_HEADER" != "true" ]; then + bash "./GUI.sh" -nh + else + bash "./GUI.sh" + fi else - echo "Warning: CCPVEOffline.sh not found. Skipping." + echo "Warning: GUI.sh not found. Skipping." fi echo "Done." \ No newline at end of file diff --git a/Cluster/AddNodes.sh b/Cluster/AddNodes.sh index c3ab596..1390452 100644 --- a/Cluster/AddNodes.sh +++ b/Cluster/AddNodes.sh @@ -55,8 +55,6 @@ declare -a NODES=() USE_LINK1=false declare -a LINK1=() -echo $NODES - while [[ $# -gt 0 ]]; do case "$1" in --link1) diff --git a/CCPVEOffline.sh b/GUI.sh similarity index 93% rename from CCPVEOffline.sh rename to GUI.sh index 69f14fa..44897be 100644 --- a/CCPVEOffline.sh +++ b/GUI.sh @@ -1,15 +1,17 @@ #!/bin/bash # -# CCPVEOffline.sh +# GUI.sh # # A menu-driven Bash script to navigate and run .sh files in the current folder (and subfolders). # This version assumes everything is already extracted/unzipped in this directory—no download or unzip needed. # +# ./GUI.sh [-nh] +# # Usage: # 1) cd into the directory containing your .sh files (and this script). # 2) chmod +x MakeScriptsExecutable.sh # 3) ./MakeScriptsExecutable.sh -# 4) ./CCPVEOffline.sh +# 4) ./GUI.sh # # Author: Coela Can't! (coelacant1) # Repo: https://github.com/coelacant1/ProxmoxScripts @@ -26,6 +28,7 @@ DISPLAY_PREFIX="cc_pve" # How we display the "root" in the UI HELP_FLAG="--help" # If your scripts support a help flag, we pass this LAST_SCRIPT="" # The last script run LAST_OUTPUT="" # Truncated output of the last script +SHOW_HEADER="true" ############################################################################### # IMPORT UTILITY FUNCTIONS FOR SCRIPTS AND COLOR GRADIENT LIBRARY @@ -34,6 +37,23 @@ LAST_OUTPUT="" # Truncated output of the last script source "./Utilities/Utilities.sh" source "./Utilities/Colors.sh" +############################################################################### +# HEADER MANAGEMENT +############################################################################### + +while [[ $# -gt 0 ]]; do + case "$1" in + -nh) + SHOW_HEADER="false" + shift + ;; + *) + echo "Error: Unknown argument '$1'" + exit 1 + ;; + esac +done + ############################################################################### # ASCII ART HEADER ############################################################################### @@ -82,12 +102,23 @@ EOF ) SMALL_LENGTH=44 +BASIC_ASCII=$(cat <<'EOF' +---------------------------------------- + █▀▀ █▀▀ █▀█ █ █ █▀▀  + █   █   █▀▀ ▀▄▀ █▀▀  + ▀▀▀ ▀▀▀ ▀    ▀  ▀▀▀  +---------------------------------------- +EOF +) + show_ascii_art() { local width width=$(tput cols) # We'll pick a gradient from purple (128,0,128) to cyan (0,255,255) - if ((LARGE_LENGTH <= width)); then + if [ "$SHOW_HEADER" != "true" ]; then + echo "$BASIC_ASCII" + elif ((LARGE_LENGTH <= width)); then gradient_print "$LARGE_ASCII" 128 0 128 0 255 255 "█" else gradient_print "$SMALL_ASCII" 128 0 128 0 255 255 @@ -297,7 +328,7 @@ navigate() { echo echo "----------------------------------------" echo - echo "Type 'h' to show top comments for a script." + echo "Type 'h' to show script comments." echo "Type 'b' to go up one directory." echo "Type 'e' to exit." echo @@ -377,6 +408,5 @@ navigate() { # MAIN ############################################################################### -apt update || true ./MakeScriptsExecutable.sh navigate "$BASE_DIR" diff --git a/Host/-Backup.sh b/Host/-Backup.sh index e69de29..aa9afa1 100644 --- a/Host/-Backup.sh +++ b/Host/-Backup.sh @@ -0,0 +1 @@ +# backup one or all nodes to ssh target \ No newline at end of file diff --git a/README.md b/README.md index 592caae..e52a2ac 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,12 @@ Or an even shorter single line call: bash <(curl -L pve.coela.sh) ``` + +Short single line call with a minimal header: +```bash +bash <(curl -L pve.coela.sh) -nh +``` + ![Single Line Online Command](.site/SingleLineCommand.png) ### Installation