mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-04-19 23:28:07 +00:00
Update build.func
This commit is contained in:
parent
b0a896cfcb
commit
220de44ee5
@ -288,20 +288,19 @@ 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
|
||||||
curl -fsSL "$local_header_path" "$header_url"
|
if ! curl -fsSL "$header_url" -o "$local_header_path"; then
|
||||||
if [ $? -ne 0 ]; then
|
echo -e "${WARN:-}[WARN]${BOLD:-}${YLW:-} Failed to download header for ${app_name}. No header will be displayed.${CL:-}"
|
||||||
echo -e "${WARN}${BOLD}${YLW}Failed to download header for ${app_name}. No header will be displayed.${CL}"
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat "$local_header_path"
|
cat "$local_header_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user