#! /bin/sh
################################################################################
# PROJECT:
#   LANE MACHINE USER INTERFACE
#
# FILE NAME:
#  get_mac_address
#
# PURPOSE:
#  This script returns the mac address of the specified device.
#
# NOTES:
#  Input value is the device to check. example: eth0 or eth1
#  The default value is eth0
#
# COPYRIGHT NOTICE:
#  Copyright 2004 All rights reserved
#  Brunswick Corp.
#  Proprietary Information
#
# REVISION HISTORY:
#     v1.0 2007/12/12 12:00:00 jproefrock - Initial
################################################################################
IFCONFIG="/sbin/ifconfig"
DEVICE="eth0"
GREP="/bin/grep"
SED="/bin/sed"
AWK="/bin/awk"
UI_PATH="/opt/LM_GUI"
USB_PATH="/mnt/usb"

# Test input
if [ $# != 0 ]
    then
    DEVICE="$1"
fi

#get mac address
$IFCONFIG $DEVICE | $GREP "HWaddr"  | $SED 's/eth[0-9]\{1\}[ ]\{1,10\}Link[ ]\{1,10\}encap:Ethernet[ ]\{1,10\}HWaddr[ ]\{1,10\}//g'

exit 0
