remove j2 file extensions
This commit is contained in:
@ -1,10 +1,12 @@
|
||||
[Unit]
|
||||
Description=Update /etc/issue with ethN IP addresses
|
||||
Description=Update login screen with IP addresses
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/root/update_issue.sh
|
||||
Type=oneshot
|
||||
Type=simple
|
||||
User=root
|
||||
Group=root
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
@ -1,17 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 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
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user