Skip to content

Instantly share code, notes, and snippets.

@flagranterror
Created July 13, 2012 17:32
Show Gist options
  • Save flagranterror/3106160 to your computer and use it in GitHub Desktop.
Save flagranterror/3106160 to your computer and use it in GitHub Desktop.
Populate /etc/issue with interface IPs
#!/bin/bash
cp /etc/issue-clean /etc/issue
for x in $(ip link show | egrep -o 'eth[0-9]')
do
INTERFACE=$x
for y in $(ip addr show ${INTERFACE} | grep -o 'inet .*' | awk '{ printf "%s|%s\n", $7, $2 }')
do
echo $y >> /etc/issue
done
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment