mirror of
https://github.com/community-scripts/ProxmoxVE
synced 2025-02-11 02:09:17 +00:00
Update build.func
This commit is contained in:
parent
0ea42c77a5
commit
8b2ff76684
@ -177,16 +177,20 @@ update_motd_ip() {
|
|||||||
MOTD_FILE="/etc/motd"
|
MOTD_FILE="/etc/motd"
|
||||||
|
|
||||||
if [ -f "$MOTD_FILE" ]; then
|
if [ -f "$MOTD_FILE" ]; then
|
||||||
|
# Remove existing IP Address lines to prevent duplication
|
||||||
|
sed -i '/IP Address:/d' "$MOTD_FILE"
|
||||||
|
|
||||||
IP=$(get_current_ip)
|
IP=$(get_current_ip)
|
||||||
# Update the IP address in the MOTD file
|
# Add the new IP address
|
||||||
sed -i "s/.*IP Address:.*/${TAB}${NETWORK}${YW} IP Address: ${GN}${IP}${CL}/" "$MOTD_FILE"
|
echo -e "${TAB}${NETWORK}${YW} IP Address: ${GN}${IP}${CL}" >> "$MOTD_FILE"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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
|
||||||
msg_info "Figlet not found. Installing..."
|
msg_info "${OS}${BOLD}${DGN}Figlet for ASCII-Header not found. Installing..."
|
||||||
|
|
||||||
# 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
|
||||||
@ -208,7 +212,7 @@ header_info() {
|
|||||||
cd /tmp/figlet
|
cd /tmp/figlet
|
||||||
|
|
||||||
# Run make to compile the figlet binary
|
# Run make to compile the figlet binary
|
||||||
make
|
make >/dev/null
|
||||||
|
|
||||||
# Check if the figlet binary exists
|
# Check if the figlet binary exists
|
||||||
if [ -f "figlet" ]; then
|
if [ -f "figlet" ]; then
|
||||||
@ -221,7 +225,7 @@ header_info() {
|
|||||||
cp -r /tmp/figlet/fonts/*.flf /usr/local/share/figlet/
|
cp -r /tmp/figlet/fonts/*.flf /usr/local/share/figlet/
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_ok "Figlet successfully installed and moved to /usr/local/bin"
|
msg_ok "${OS}${BOLD}${DGN}Figlet successfully installed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf "$temp_dir"
|
rm -rf "$temp_dir"
|
||||||
|
Loading…
Reference in New Issue
Block a user