mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-11 02:09:17 +00:00
test with toilet
This commit is contained in:
parent
8dc1ac63f2
commit
0be8d072ab
@ -158,13 +158,13 @@ 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 ! command -v banner &> /dev/null; then
|
if ! command -v toilet &> /dev/null; then
|
||||||
# Install banner for Debian/Ubuntu-based systems
|
# Install toilet for Debian/Ubuntu-based systems
|
||||||
if [ -f /etc/debian_version ]; then
|
if [ -f /etc/debian_version ]; then
|
||||||
apt-get update -y &> /dev/null
|
apt-get update -y &> /dev/null
|
||||||
apt-get install -y sysvbanner &> /dev/null
|
apt-get install -y toilet &> /dev/null
|
||||||
elif [ -f /etc/alpine-release ]; then
|
elif [ -f /etc/alpine-release ]; then
|
||||||
apk add --no-cache sysvbanner &> /dev/null
|
apk add --no-cache toilet &> /dev/null
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
@ -172,17 +172,7 @@ header_info() {
|
|||||||
|
|
||||||
clear
|
clear
|
||||||
term_width=$(tput cols 2>/dev/null || echo 80) # Fallback to 80 columns
|
term_width=$(tput cols 2>/dev/null || echo 80) # Fallback to 80 columns
|
||||||
echo
|
toilet --width "$term_width" --gay "$APP"
|
||||||
banner "$APP" | fold -w "$term_width"
|
|
||||||
echo
|
|
||||||
}
|
|
||||||
|
|
||||||
term_width=$(tput cols 2>/dev/null || echo 120) # Fallback to 120 columns
|
|
||||||
ascii_art=$(figlet -f slant -w "$term_width" "$APP")
|
|
||||||
clear
|
|
||||||
cat <<EOF
|
|
||||||
$ascii_art
|
|
||||||
EOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function checks if the script is running through SSH and prompts the user to confirm if they want to proceed or exit.
|
# This function checks if the script is running through SSH and prompts the user to confirm if they want to proceed or exit.
|
||||||
|
Loading…
Reference in New Issue
Block a user