文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>check MAC

check MAC

时间:2007-04-24  来源:lalf

chkmac.sh
#!/bin/bash
#Program
#This script is used to check the mac address
#History
#2006/11/28 Lalf First release
MAC0=`ifconfig eth0 |grep "HWaddr" | awk '{print $5}'`
MACaddr0=`echo $MAC0 | awk -F ":" '{print $1 $2 $3 $4 $5 $6}'`
        echo "***** Begin Check NIC0 MAC Address *****"
        echo "Please Input NIC0 MAC Address:"
        while [ "1" = "1" ]
        do
        read inputMAC0
        mac_count=$(echo $inputMAC0 | wc -c)
        if [ $mac_count -ne 13 ]; then
                        echo "****************************"
                        echo "*  NIC0 MAC is incorrect,it should be 12 length       *"
                        echo "*  Please Input Again:   *"
                        echo "****************************"
                        continue;
        fi
        if [ "$inputMAC0" = "$MACaddr0" -o "$inputMAC0" = "$MACaddr1" ];then
                echo "NIC0 MAC Check PASS"
        else
                echo "NIC0 MAC Check Fail"
                echo "Input $inputMAC0, but real $MACaddr0"
                read fei
                exit 1
        fi
        break;
        done
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载