From 3e23659bbe5348b4226874e4d6aa01d206a5597c Mon Sep 17 00:00:00 2001 From: MickLesk Date: Mon, 3 Aug 2026 09:15:54 +0200 Subject: [PATCH] fix headers --- .../workflows/scripts/generate-app-headers.sh | 4 ++- tools/addon/add-netbird-lxc.sh | 28 ++++++------------- tools/addon/add-tailscale-lxc.sh | 14 ---------- tools/addon/all-templates.sh | 14 +--------- tools/addon/netdata.sh | 15 ---------- tools/addon/webmin.sh | 11 -------- 6 files changed, 12 insertions(+), 74 deletions(-) diff --git a/.github/workflows/scripts/generate-app-headers.sh b/.github/workflows/scripts/generate-app-headers.sh index 96050795e..e9674491b 100755 --- a/.github/workflows/scripts/generate-app-headers.sh +++ b/.github/workflows/scripts/generate-app-headers.sh @@ -24,7 +24,9 @@ generate_headers() { app_name=$(grep -oP '^APP="\K[^"]+' "$script" 2>/dev/null) if [[ -n "$app_name" ]]; then - output_file="${headers_dir}/$(basename "${script%.*}")" + # core.func/vm-core.func look the header up as "${APP,,}" without spaces, + # so the generated file has to be named after APP - not after the script. + output_file="${headers_dir}/$(echo "${app_name,,}" | tr -d ' ')" figlet_output=$(figlet -w 500 -f slant "$app_name") if [[ -n "$figlet_output" ]]; then echo "$figlet_output" >"$output_file" diff --git a/tools/addon/add-netbird-lxc.sh b/tools/addon/add-netbird-lxc.sh index ce2599670..6015159d0 100644 --- a/tools/addon/add-netbird-lxc.sh +++ b/tools/addon/add-netbird-lxc.sh @@ -19,33 +19,21 @@ declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "add-netbird-l set -Eeuo pipefail trap 'error_handler' ERR -function header_info { - clear - cat <<"EOF" - _ __ __ ____ _ __ - / | / /__ / /_/ __ )(_)________/ / - / |/ / _ \/ __/ __ / / ___/ __ / - / /| / __/ /_/ /_/ / / / / /_/ / -/_/ |_/\___/\__/_____/_/_/ \__,_/ - -EOF -} - # Initialize all core functions (colors, formatting, icons, STD mode) load_functions header_info while true; do - read -r -p "This will add NetBird to an existing LXC Container ONLY. Proceed(y/n)?" yn + read -r -p "This will add NetBird to an existing LXC Container ONLY. Proceed(y/n)? " yn case $yn in [Yy]*) break ;; [Nn]*) exit 0 ;; *) echo "Please answer yes or no." ;; esac done -header_info -msg_info "Loading container list..." + +echo -e "Loading container list..." NODE=$(hostname) MSG_MAX_LENGTH=0 @@ -88,18 +76,18 @@ cat <>"$CTID_CONFIG_PATH" lxc.cgroup2.devices.allow: c 10:200 rwm lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file EOF -header_info + msg_info "Installing NetBird" pct exec "$CTID" -- bash -c ' if ! command -v curl &>/dev/null; then - apt-get update -qq - apt-get install -y curl >/dev/null + apt update -qq + apt install -y curl >/dev/null fi apt install -y ca-certificates gpg &>/dev/null curl -fsSL "https://pkgs.netbird.io/debian/public.key" | gpg --dearmor >/usr/share/keyrings/netbird-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/netbird-archive-keyring.gpg] https://pkgs.netbird.io/debian stable main" >/etc/apt/sources.list.d/netbird.list -apt-get update &>/dev/null -apt-get install -y netbird-ui &>/dev/null +apt update &>/dev/null +apt install -y netbird-ui &>/dev/null if systemctl list-unit-files docker.service &>/dev/null; then mkdir -p /etc/systemd/system/netbird.service.d cat </etc/systemd/system/netbird.service.d/after-docker.conf diff --git a/tools/addon/add-tailscale-lxc.sh b/tools/addon/add-tailscale-lxc.sh index 76487ad83..28c531360 100644 --- a/tools/addon/add-tailscale-lxc.sh +++ b/tools/addon/add-tailscale-lxc.sh @@ -18,18 +18,6 @@ declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "add-tailscale set -Eeuo pipefail trap 'error_handler' ERR -function header_info() { - clear - cat <<"EOF" - ______ _ __ __ - /_ __/___ _(_) /_____________ _/ /__ - / / / __ `/ / / ___/ ___/ __ `/ / _ \ - / / / /_/ / / (__ ) /__/ /_/ / / __/ -/_/ \__,_/_/_/____/\___/\__,_/_/\___/ - -EOF -} - # Initialize all core functions (colors, formatting, icons, STD mode) load_functions @@ -49,7 +37,6 @@ while true; do esac done -header_info msg_info "Loading container list..." NODE=$(hostname) @@ -78,7 +65,6 @@ CTID_CONFIG_PATH="/etc/pve/lxc/${CTID}.conf" grep -q "lxc.cgroup2.devices.allow: c 10:200 rwm" "$CTID_CONFIG_PATH" || echo "lxc.cgroup2.devices.allow: c 10:200 rwm" >>"$CTID_CONFIG_PATH" grep -q "lxc.mount.entry: /dev/net/tun" "$CTID_CONFIG_PATH" || echo "lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file" >>"$CTID_CONFIG_PATH" -header_info msg_info "Installing Tailscale in CT $CTID" pct exec "$CTID" -- sh -c ' diff --git a/tools/addon/all-templates.sh b/tools/addon/all-templates.sh index 5ab97068f..50cf697e4 100644 --- a/tools/addon/all-templates.sh +++ b/tools/addon/all-templates.sh @@ -13,17 +13,6 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/api.func) 2>/dev/null || true declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "all-templates" "addon" -function header_info { - clear - cat <<"EOF" - ___ ____ ______ __ __ - / _ | / / / /_ __/__ __ _ ___ / /__ _/ /____ ___ - / __ |/ / / / / / -_) ' \/ _ \/ / _ `/ __/ -_|_-< -/_/ |_/_/_/ /_/ \__/_/_/_/ .__/_/\_,_/\__/\__/___/ - /_/ -EOF -} - # Enable error handling; destroy any partially-created container before reporting the error set -Eeuo pipefail function _cleanup_on_error() { @@ -172,7 +161,7 @@ function select_storage() { printf $STORAGE fi } -header_info + # Get template storage TEMPLATE_STORAGE=$(select_storage template) msg_info "Using '$TEMPLATE_STORAGE' for template storage." @@ -238,7 +227,6 @@ if [[ -f /etc/systemd/system/ping-instances.service ]]; then fi # Success message -header_info echo msg_ok "LXC container '$CTID' was successfully created, and its IP address is ${IP}." echo diff --git a/tools/addon/netdata.sh b/tools/addon/netdata.sh index c062a360a..ba6ea29ee 100644 --- a/tools/addon/netdata.sh +++ b/tools/addon/netdata.sh @@ -21,18 +21,6 @@ trap 'error_handler' ERR # Initialize all core functions (colors, formatting, icons, STD mode) load_functions -function header_info { - clear - cat <<"EOF" - _ __ __ ____ __ - / | / /__ / /_/ __ \____ _/ /_____ _ - / |/ / _ \/ __/ / / / __ `/ __/ __ `/ - / /| / __/ /_/ /_/ / /_/ / /_/ /_/ / -/_/ |_/\___/\__/_____/\__,_/\__/\__,_/ - -EOF -} - detect_codename() { source /etc/os-release if [[ "$ID" != "debian" ]]; then @@ -56,7 +44,6 @@ get_latest_repo_pkg() { } install() { - header_info while true; do read -r -p "Are you sure you want to install ${APP} on Proxmox VE host. Proceed(y/n)? " yn case $yn in @@ -92,8 +79,6 @@ install() { } uninstall() { - header_info - msg_info "Uninstalling ${APP}" systemctl stop netdata || true rm -rf /var/log/netdata /var/lib/netdata /var/cache/netdata /etc/netdata/go.d diff --git a/tools/addon/webmin.sh b/tools/addon/webmin.sh index 3e4317d49..38ea6e202 100644 --- a/tools/addon/webmin.sh +++ b/tools/addon/webmin.sh @@ -21,17 +21,6 @@ trap 'error_handler' ERR # Initialize all core functions (colors, formatting, icons, STD mode) load_functions -function header_info { - clear - cat <<"EOF" - _ __ __ _ - | | /| / /__ / / __ _ (_)__ - | |/ |/ / -_) _ \/ ' \/ / _ \ - |__/|__/\__/_.__/_/_/_/_/_//_/ - -EOF -} - header_info whiptail --backtitle "Proxmox VE Helper Scripts" --title "${APP} Installer" --yesno "This Will Install ${APP} on this LXC Container. Proceed?" 10 58