LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 894|回复: 1

有谁可以把/usr/share/doc/ifupdown/example/get-mac-address.sh发给我

[复制链接]
发表于 2006-11-19 23:02:45 | 显示全部楼层 |阅读模式
有谁可以把/usr/share/doc/ifupdown/example/get-mac-address.sh发给我

邮箱是QowoQ@163.com

我执行了一下这个脚本,然后里面的内容就被改写成屏幕上输出的东西了!

所以想再要一份
发表于 2006-11-20 20:06:21 | 显示全部楼层
#!/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
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表