home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Welt 2006 November (DVD)
/
PCWELT_11_2006.ISO
/
casper
/
filesystem.squashfs
/
usr
/
share
/
doc
/
ifupdown
/
examples
/
get-mac-address.sh
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Linux/UNIX/POSIX Shell Script
|
2005-05-12
|
380 b
|
18 lines
#!/bin/sh
set -e
export LANG=C
iface="$1"
mac=$(/sbin/ifconfig "$iface" | sed -n -e '/^.*HWaddr \([:[:xdigit:]]*\).*/{s//\1/;y/ABCDEF/abcdef/;p;q;}')
which=""
while read testmac scheme; do
if [ "$which" ]; then continue; fi
if [ "$mac" = "$(echo "$testmac" | sed -e 'y/ABCDEF/abcdef/')" ]; then which="$scheme"; fi
done
if [ "$which" ]; then echo $which; exit 0; fi
exit 1