您的位置:首页 > 运维架构 > Shell

shell获取mac地址

2015-06-04 12:28 501 查看
http://blog.csdn.net/shaobingj126/article/details/7376737

可用使用

#读取服务器的MAC地址

MAC=$(ifconfig eth0|grep eth0|awk '{print $5}')

#读取服务器的硬件序列号

hdparm -I /dev/sda > /hdSerial.txt

hdSer=$(grep \\"Serial Number" hdSerial.txt)

SER=$(echo ${hdSer#*:})
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: