refactor: remove inline header_info from addons, use core.func get_header()

- get_header() in core.func now maps APP_TYPE=addon to tools/headers/ path
- Removed 5 duplicate ASCII art header_info functions from addon scripts
- Addons now use the shared header_info() from core.func + tools/headers/ files
This commit is contained in:
CanbiZ (MickLesk)
2026-02-24 13:32:08 +01:00
parent 881eb5bd04
commit fa766d22bf
6 changed files with 3 additions and 79 deletions

View File

@@ -788,7 +788,9 @@ exit_script() {
get_header() {
local app_name=$(echo "${APP,,}" | tr -d ' ')
local app_type=${APP_TYPE:-ct} # Default to 'ct' if not set
local header_url="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/${app_type}/headers/${app_name}"
local header_dir="${app_type}"
[[ "$app_type" == "addon" ]] && header_dir="tools"
local header_url="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/${header_dir}/headers/${app_name}"
local local_header_path="/usr/local/community-scripts/headers/${app_type}/${app_name}"
mkdir -p "$(dirname "$local_header_path")"

View File

@@ -34,22 +34,6 @@ DEFAULT_PORT=8000
# Initialize all core functions (colors, formatting, icons, STD mode)
load_functions
# ==============================================================================
# HEADER
# ==============================================================================
function header_info {
clear
cat <<"EOF"
______ ___ ____
/ ____/___ ____ / (_)/ __/_ __
/ / / __ \/ __ \/ / / /_/ / / /
/ /___/ /_/ / /_/ / / / __/ /_/ /
\____/\____/\____/_/_/_/ \__, /
/____/
EOF
}
# ==============================================================================
# UNINSTALL
# ==============================================================================

View File

@@ -36,22 +36,6 @@ DEFAULT_PORT=5001
# Initialize all core functions (colors, formatting, icons, STD mode)
load_functions
# ==============================================================================
# HEADER
# ==============================================================================
function header_info {
clear
cat <<"EOF"
____ __
/ __ \____ _____/ /______ ____
/ / / / __ \/ ___/ //_/ __ `/ _ \
/ /_/ / /_/ / /__/ ,< / /_/ / __/
/_____/\____/\___/_/|_|\__, /\___/
/____/
EOF
}
# ==============================================================================
# UNINSTALL
# ==============================================================================

View File

@@ -34,22 +34,6 @@ DEFAULT_PORT=3000
# Initialize all core functions (colors, formatting, icons, STD mode)
load_functions
# ==============================================================================
# HEADER
# ==============================================================================
function header_info {
clear
cat <<"EOF"
____ __ __
/ __ \____ / /______ / /___ __ __
/ / / / __ \/ //_/ __ \/ / __ \/ / / /
/ /_/ / /_/ / ,< / /_/ / / /_/ / /_/ /
/_____/\____/_/|_| .___/_/\____/\__, /
/_/ /____/
EOF
}
# ==============================================================================
# UNINSTALL
# ==============================================================================

View File

@@ -30,21 +30,6 @@ DEFAULT_PORT=9120
# Initialize all core functions (colors, formatting, icons, STD mode)
load_functions
# ==============================================================================
# HEADER
# ==============================================================================
function header_info {
clear
cat <<"EOF"
__ __ __
/ //_/___ ____ ___ ____ ____/ /___
/ ,< / __ \/ __ `__ \/ __ \/ __ / __ \
/ /| |/ /_/ / / / / / / /_/ / /_/ / /_/ /
/_/ |_|\____/_/ /_/ /_/\____/\__,_/\____/
EOF
}
# ==============================================================================
# HELPERS
# ==============================================================================

View File

@@ -34,21 +34,6 @@ DEFAULT_PORT=80
# Initialize all core functions (colors, formatting, icons, STD mode)
load_functions
# ==============================================================================
# HEADER
# ==============================================================================
function header_info {
clear
cat <<"EOF"
____ __ _ _
/ __ \__ ______ / /_(_)__ (_)
/ /_/ / / / / __ \/ __/ / _ \/ /
/ _, _/ /_/ / / / / /_/ / ___/ /
/_/ |_|\__,_/_/ /_/\__/_/_/ /_/
EOF
}
# ==============================================================================
# PROXMOX HOST CHECK
# ==============================================================================