1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-03-08 13:19:05 +00:00

Update build.func

This commit is contained in:
CanbiZ 2024-12-28 18:52:36 +01:00 committed by GitHub
parent 8816bced80
commit 4794dce136
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -158,18 +158,34 @@ arch_check() {
# 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.
header_info() { header_info() {
if [ -f /etc/debian_version ]; then if ! command -v figlet &> /dev/null; then
# Debian/Ubuntu # Check for Debian/Ubuntu-based systems
apt-get install -y figlet &> /dev/null if [ -f /etc/debian_version ]; then
elif [ -f /etc/alpine-release ]; then apt-get update -y &> /dev/null
# Alpine Linux apt-get install -y build-essential git &> /dev/null
apk add --no-cache figlet &> /dev/null elif [ -f /etc/alpine-release ]; then
else # For Alpine Linux
echo "Unsupported OS" apk add --no-cache build-base git ncurses &> /dev/null
return 1 export TERM=xterm
else
return 1
fi
# Build and install figlet from source
temp_dir=$(mktemp -d)
git clone https://github.com/cmatsuoka/figlet.git "$temp_dir" &> /dev/null
cd "$temp_dir" || exit 1
make &> /dev/null
make install &> /dev/null
cd - &> /dev/null
rm -rf "$temp_dir"
if ! command -v figlet &> /dev/null; then
return 1
fi
fi fi
term_width=$(tput cols) term_width=$(tput cols 2>/dev/null || echo 120) # Fallback to 120 columns
ascii_art=$(figlet -f slant -w "$term_width" "$APP") ascii_art=$(figlet -f slant -w "$term_width" "$APP")
clear clear
cat <<EOF cat <<EOF