#!/bin/bash
#
ifconfig en0 | grep "10\.\|192\." | grep -F ".255"
if [ $? = 0 ]; then
status=0
mac=$(ifconfig en0 | grep ether | grep ..:..:..:..:..:.. | awk '{print $NF}')
ip=$(ifconfig en0 | grep -i -F "inet" | grep -F ".255" | awk '{print $2}')
else
mac=" "
ip=" "
fi
ifconfig en1 | grep "10\.\|192\." | grep -F ".255"
if [ $? = 0 ]; then
status=0
mac1=$(ifconfig en1 | grep ether | grep ..:..:..:..:..:.. | awk '{print $NF}')
ip1=$(ifconfig en1 | grep -i -F "inet" | grep -F ".255" | awk '{print $2}')
else
mac1=" "
ip1=" "
fi
str="mac: ${mac},ip:${ip}"
str1="mac1: ${mac1},ip1:${ip1}"
(/usr/bin/osascript -e "display dialog \"$str \\n$str1\" buttons {\"OK\"} default button \"OK\" " )