mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-02-01 22:51:50 +00:00
Update build.func
This commit is contained in:
parent
5230bc7ee9
commit
06b03b2259
@ -189,7 +189,7 @@ update_motd_ip() {
|
|||||||
header_info() {
|
header_info() {
|
||||||
# Check if figlet is installed
|
# Check if figlet is installed
|
||||||
if ! command -v figlet &> /dev/null; then
|
if ! command -v figlet &> /dev/null; then
|
||||||
echo -e "${INFO}${BOLD}${DGN}Figlet for ASCII-Header not found. Installing...${CL}"
|
echo -e "${INFO}${BOLD}${DGN}Figlet for ASCII-Header not found. Installing... ${CL}"
|
||||||
|
|
||||||
# Install necessary dependencies and figlet
|
# Install necessary dependencies and figlet
|
||||||
if [ -f /etc/debian_version ] || [ -f /etc/lsb-release ]; then
|
if [ -f /etc/debian_version ] || [ -f /etc/lsb-release ]; then
|
||||||
@ -201,35 +201,26 @@ header_info() {
|
|||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
temp_dir=$(mktemp -d)
|
temp_dir=$(mktemp -d)
|
||||||
curl -sL https://github.com/community-scripts/ProxmoxVE/raw/refs/heads/develop/misc/figlet.tar.xz -o "$temp_dir/figlet.tar.xz"
|
curl -sL https://github.com/community-scripts/ProxmoxVE/raw/refs/heads/develop/misc/figlet.tar.xz -o "$temp_dir/figlet.tar.xz"
|
||||||
|
|
||||||
mkdir -p /tmp/figlet
|
mkdir -p /tmp/figlet
|
||||||
tar -xf "$temp_dir/figlet.tar.xz" -C /tmp/figlet --strip-components=1
|
tar -xf "$temp_dir/figlet.tar.xz" -C /tmp/figlet --strip-components=1
|
||||||
|
|
||||||
cd /tmp/figlet
|
cd /tmp/figlet
|
||||||
|
|
||||||
# Run make to compile the figlet binary
|
# Run make to compile the figlet binary
|
||||||
make >/dev/null
|
make >/dev/null
|
||||||
|
|
||||||
# Check if the figlet binary exists
|
# Check if the figlet binary exists
|
||||||
if [ -f "figlet" ]; then
|
if [ -f "figlet" ]; then
|
||||||
chmod +x figlet
|
chmod +x figlet
|
||||||
|
|
||||||
# Move figlet to /usr/local/bin if not already there
|
# Move figlet to /usr/local/bin if not already there
|
||||||
if [ ! -e /usr/local/bin/figlet ]; then
|
if [ ! -e /usr/local/bin/figlet ]; then
|
||||||
mv figlet /usr/local/bin/
|
mv figlet /usr/local/bin/
|
||||||
mkdir -p /usr/local/share/figlet
|
mkdir -p /usr/local/share/figlet
|
||||||
cp -r /tmp/figlet/fonts/*.flf /usr/local/share/figlet/
|
cp -r /tmp/figlet/fonts/*.flf /usr/local/share/figlet/
|
||||||
fi
|
fi
|
||||||
|
echo -e "${CM}${BOLD}${DGN}Figlet successfully installed. ${CL}"
|
||||||
echo -e "${CM}${BOLD}${DGN}Figlet successfully installed.${CL}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf "$temp_dir"
|
rm -rf "$temp_dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
term_width=$(tput cols 2>/dev/null || echo 120)
|
term_width=$(tput cols 2>/dev/null || echo 120)
|
||||||
ascii_art=$(figlet -f slant -w "$term_width" "$APP")
|
ascii_art=$(figlet -f slant -w "$term_width" "$APP")
|
||||||
clear
|
clear
|
||||||
|
Loading…
x
Reference in New Issue
Block a user