diff --git a/core/core.func b/core/core.func index 2afa60a..ae98de0 100644 --- a/core/core.func +++ b/core/core.func @@ -1401,6 +1401,15 @@ exit_script() { # - Determines app type (ct/vm) from APP_TYPE variable # - Returns header content or empty string on failure # ------------------------------------------------------------------------------ +# Drawn until the generator has produced a script's own banner (figlet slant, +# like the generated ones); the app name follows in plain text. +_CS_FALLBACK_HEADER=' ______ _ __ _____ _ __ + / ____/___ ____ ___ ____ ___ __ ______ (_) /___ __ / ___/__________(_)___ / /______ + / / / __ \/ __ `__ \/ __ `__ \/ / / / __ \/ / __/ / / / \__ \/ ___/ ___/ / __ \/ __/ ___/ +/ /___/ /_/ / / / / / / / / / / / /_/ / / / / / /_/ /_/ / ___/ / /__/ / / / /_/ / /_(__ ) +\____/\____/_/ /_/ /_/_/ /_/ /_/\__,_/_/ /_/_/\__/\__, / /____/\___/_/ /_/ .___/\__/____/ + /____/ /_/' + get_header() { # Slug must match what the generator writes: APP lowercased, spaces removed. local app_name=$(echo "${APP,,}" | tr -d ' ') @@ -1483,6 +1492,9 @@ header_info() { if [ -n "$header_content" ]; then echo "$header_content" + else + echo "${_CS_FALLBACK_HEADER:-Community Scripts}" + echo " ${APP:-}" fi } diff --git a/incus/build.func b/incus/build.func index 327293e..c8fa33d 100644 --- a/incus/build.func +++ b/incus/build.func @@ -553,7 +553,12 @@ header_info() { header_content=$(get_header "$app_name" 2>/dev/null || true) fi clear 2>/dev/null || true - [[ -n "$header_content" ]] && echo "$header_content" + if [[ -n "$header_content" ]]; then + echo "$header_content" + else + echo "${_CS_FALLBACK_HEADER:-Community Scripts}" + echo " ${APP:-}" + fi return 0 } diff --git a/incus/tools.func b/incus/tools.func index fb29241..e521407 100644 --- a/incus/tools.func +++ b/incus/tools.func @@ -317,7 +317,8 @@ header_info() { if [[ -n "$header_content" ]]; then echo "$header_content" else - echo -e "${INCUS_HEADER:-Incus :: ${APP:-Container}}" + echo "${_CS_FALLBACK_HEADER:-Community Scripts}" + echo " ${APP:-}" fi } diff --git a/incus/vm-core.func b/incus/vm-core.func index 1e4633d..b247edf 100644 --- a/incus/vm-core.func +++ b/incus/vm-core.func @@ -65,18 +65,20 @@ load_incus_vm_functions() { load_functions() { load_incus_vm_functions; } header_info() { - # get_header derives the slug from APP and APP_TYPE itself. Same contract as - # the Proxmox path: no banner means draw nothing. The text fallback this used - # to print ("Incus VM :: Home Assistant OS") read like the banner had been - # replaced on purpose, so a header that simply failed to fetch looked like a - # deliberate design rather than the missing artwork it is. + # get_header derives the slug from APP and APP_TYPE itself; without a banner + # the shared placeholder from core.func is drawn, same as on Proxmox. local header_content="" APP_TYPE="${APP_TYPE:-vm}" if declare -f get_header >/dev/null 2>&1; then header_content=$(get_header 2>/dev/null || true) fi _cs_clear - [[ -n "$header_content" ]] && echo "$header_content" + if [[ -n "$header_content" ]]; then + echo "$header_content" + else + echo "${_CS_FALLBACK_HEADER:-Community Scripts}" + echo " ${APP:-}" + fi return 0 } diff --git a/pve/vm-core.func b/pve/vm-core.func index 2eb95b8..b9aab0b 100644 --- a/pve/vm-core.func +++ b/pve/vm-core.func @@ -201,6 +201,9 @@ header_info() { if [ -n "$header_content" ]; then echo "$header_content" + else + echo "${_CS_FALLBACK_HEADER:-Community Scripts}" + echo " ${APP:-}" fi }