Files
pxe_server/files/init/update_issue.sh
2025-10-12 19:13:00 -07:00

32 lines
579 B
Bash
Executable File

#!/bin/bash
i=1
while [ $i ]
do
# Retrieve IP addresses of interfaces
ip_addresses=$(ip -o -4 addr show | awk '(/eth|en|wl|wn|vmpbr0|tun/) {print $2 "," $4 "\r"}' | column -s , -t)
# Get OS Build Info
os_build=$(cat /etc/os-release | grep PRETTY | cut -d "\"" -f 2)
# Put hostname in a variable that probably isn't reserved or anything
host_name=$(hostname)
# Write to /etc/issue
{
echo $os_build
echo "Hostname: ${host_name}"
echo "IP Addresses:"
echo "$ip_addresses"
} > /etc/issue
sleep 1
done