#!/bin/bash

# second way to generate a list of IPs (less nice looking output)
# ip -o addr | awk '!/^[0-9]*: ?lo|link\/ether/ {gsub("/", " "); print $2" "$4}'
# we use the older programm ifconfig, as it is still fully supported for our debian
# /sbin/ifconfig | awk -v RS="\n\n" '{ for (i=1; i<=NF; i++) if ($i == "inet" && $(i+1) ~ /^addr:/) address = substr($(i+1), 6); if (address != "127.0.0.1") printf "%s\t%s\n", $1, address }'

IPLIST=$( /sbin/ifconfig | awk -v RS="\n\n" '{ for (i=1; i<=NF; i++) if ($i == "inet" && $(i+1) ~ /^addr:/) address = substr($(i+1), 6); if (address != "127.0.0.1") printf "%s\t%s\n", $1, address }' )
echo "Debian GNU/Linux 6.0 \n \l" > /etc/issue
echo "$IPLIST" >> /etc/issue