1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-04-20 01:08:07 +00:00

Update build.func

This commit is contained in:
CanbiZ 2025-04-01 10:37:05 +02:00 committed by GitHub
parent b0a896cfcb
commit 220de44ee5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -288,21 +288,20 @@ update_motd_ip() {
# Function to download & save header files # Function to download & save header files
get_header() { get_header() {
local app_name=$(echo ${APP,,} | tr -d ' ') local app_name=$(echo "${APP,,}" | tr -d ' ')
local header_url="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw/main/ct/headers/${app_name}" local header_url="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/headers/${app_name}"
local local_header_path="/usr/local/community-scripts/headers/${app_name}" local local_header_path="/usr/local/community-scripts/headers/${app_name}"
mkdir -p "/usr/local/community-scripts/headers" mkdir -p "$(dirname "$local_header_path")"
# Check if local file already present if [ ! -s "$local_header_path" ]; then
if [ ! -s "$local_header_path" ]; then if ! curl -fsSL "$header_url" -o "$local_header_path"; then
curl -fsSL "$local_header_path" "$header_url" echo -e "${WARN:-}[WARN]${BOLD:-}${YLW:-} Failed to download header for ${app_name}. No header will be displayed.${CL:-}"
if [ $? -ne 0 ]; then return 1
echo -e "${WARN}${BOLD}${YLW}Failed to download header for ${app_name}. No header will be displayed.${CL}" fi
return 1
fi fi
fi
cat "$local_header_path" cat "$local_header_path"
} }
# This function sets the APP-Name into an ASCII Header in Slant, figlet needed on proxmox main node. # This function sets the APP-Name into an ASCII Header in Slant, figlet needed on proxmox main node.