File tree Expand file tree Collapse file tree 1 file changed +11
-12
lines changed
Expand file tree Collapse file tree 1 file changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -288,21 +288,20 @@ update_motd_ip() {
288288
289289# Function to download & save header files
290290get_header() {
291- local app_name=$(echo ${APP,,} | tr -d ' ')
292- local header_url="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/raw /main/ct/headers/${app_name}"
293- local local_header_path="/usr/local/community-scripts/headers/${app_name}"
291+ local app_name=$(echo " ${APP,,}" | tr -d ' ')
292+ local header_url="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/ct/headers/${app_name}"
293+ local local_header_path="/usr/local/community-scripts/headers/${app_name}"
294294
295- mkdir -p "/usr/local/community-scripts/headers "
295+ mkdir -p "$(dirname "$local_header_path") "
296296
297- # Check if local file already present
298- if [ ! -s "$local_header_path" ]; then
299- curl -fsSL "$local_header_path" "$header_url"
300- if [ $? -ne 0 ]; then
301- echo -e "${WARN}${BOLD}${YLW}Failed to download header for ${app_name}. No header will be displayed.${CL}"
302- return 1
297+ if [ ! -s "$local_header_path" ]; then
298+ if ! curl -fsSL "$header_url" -o "$local_header_path"; then
299+ echo -e "${WARN:-}[WARN]${BOLD:-}${YLW:-} Failed to download header for ${app_name}. No header will be displayed.${CL:-}"
300+ return 1
301+ fi
303302 fi
304- fi
305- cat "$local_header_path"
303+
304+ cat "$local_header_path"
306305}
307306
308307# This function sets the APP-Name into an ASCII Header in Slant, figlet needed on proxmox main node.
You can’t perform that action at this time.
0 commit comments