#!/bin/sh # Print interfaces addresses and names. # # (C) Sonera # Sami Kerola SYSTEM=`uname` case "$SYSTEM" in SunOS) for I in `ifconfig -a|awk '{if ($1 == "inet") {print $2}}'`; do echo "$I \c" host $I | awk '{print $5}' done ;; Linux) for I in `ifconfig -a | awk '{if ($2 ~ /addr:/) {print substr($2, 6)}}'`; do echo -n "$I " host $I | awk '{print $5}' done ;; HP-UX) for I in `netstat -ian | egrep -v '(Address|none)' | awk '{print $4}'`; do echo "$I \c" host $I | awk '{print $5}' done ;; *) echo "Unsupported platform." exit 1 ;; esac exit 0