intel 发布的, 需具备有lspci 及ethtool 两个命令. 用户查看网卡信息非常方便
#! /bin/bash
#******************************************************************************
# Copyright(c) 1999 - 2008 Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
#
# Contact Information:
# Linux NICS <linux.nics@intel.com>
# Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
#******************************************************************************
#Determine how many Ethernet & Network controllers are installed in the system
TotalControllers=`lspci | grep -c -i 'Ethernet Controller/|Network Controller'`
temp=`lspci | grep -i 'Ethernet Controller/|Network Controller'|cut -f1 -d " "`
#Define two arrays for storing IPPorts
declare -a IOPorts1
declare -a IOPorts2
#Populate IOPorts1 with bus info from lspci. Populate IoPorts2 with bus info
#from ethtool.
for (( counter=0 ; counter < $TotalControllers ; counter++ ))
do
offset=$(($counter+1))
IOPorts1[$counter]=`echo $temp|cut -f$offset -d" "`
if (ethtool -i eth$counter) &> /dev/null; then
IOPorts2[$counter]=`ethtool -i eth$counter|grep 'bus-info'|cut -f3- -d :`
fi
done
#Loop through both arrays and determine if there's a match in IOPort1 & IOPort2. If so
#then the driver is loaded, and write to screen all the related information. If there
#is no match then there isn't a driver loaded for that device and write to screen only
#the information available from lspci
for ((counter=0 ; counter < $TotalControllers ; counter++))
do
Match=0
for ((counter1=0 ; counter1 < $TotalControllers; counter1++))
do
if [ "${IOPorts1[$counter]}" = "${IOPorts2[$counter1]}" ]; then
Match=1
DeviceID=`lspci -nn | grep ${IOPorts2[$counter1]} |cut -f3- -d"["| cut -c 1-9`
EthernetController=`lspci -v |grep ${IOPorts2[$counter1]} | cut -f4- -d" "|cut -f1 -d"("`
AdapterName=`lspci -v | grep ${IOPorts2[$counter1]} -A 1 | grep 'Subsystem'|cut -f2- -d" "`
DriverName=`ethtool -i eth$counter1 | grep -i 'driver' | cut -f2 -d" "`
DriverVersion=`ethtool -i eth$counter1 | grep -m 1 -i 'version'| cut -f2 -d" "`
echo "eth$counter1 : ${IOPorts2[$counter1]}"
echo " Make/Model = $AdapterName"
echo " Ethernet controller = $EthernetController"
echo " VenID:DevID = $DeviceID"
echo " Driver name = $DriverName"
echo " Driver version = $DriverVersion"
fi
done
if [ "$Match" = "0" ] ; then
DeviceID=`lspci -nn | grep ${IOPorts1[$counter]} |cut -f3- -d"["| cut -c 1-9`
EthernetController=`lspci -v |grep ${IOPorts1[$counter]} | cut -f4- -d" "|cut -f1 -d"("`
AdapterName=`lspci -v | grep ${IOPorts1[$counter]} -A 1 | grep 'Subsystem'|cut -f2- -d" "`
echo ": ${IOPorts1[$counter]}"
echo " Make/Model = $AdapterName"
echo " Ethernet controller = $EthernetController"
echo " VenID:DevID = $DeviceID"
echo " Driver name = No driver loaded"
echo " Driver version = No driver loaded"
fi
done
exit 0
分享到:
相关推荐
intel 82574L网卡在linux下驱动
2.6.33linux虚拟网卡设备驱动
最近在做路由器二次开发,现在市面上卖的新设备,大多数都采用了2.5G网卡,现在各种Linux社区对新网卡的驱动都还不成熟,尤其是一些小众一点的网卡,有些低版本的Linux官方都没有对应版本的驱动,这里有个覆盖几乎...
教大家如何在linux下重装8169网卡驱动
该脚本使用了以下命令: cat /proc/cpuinfo: 获取 CPU 信息。 grep: 在文件中搜索字符串。 head -n 1: 获取文件的第一行。 cut -d: -f2: 从文件中的每一行中分离出第二个字段。 free: 显示系统内存使用情况。 lsblk:...
shell脚本修改linux网卡ifcfg-eth信息 说明:此脚本作用 1)当发现网卡为dhcp模式时,修改为static模式,并添加IP等信息; 2)修改网卡IP为指定的IP
Linux防火墙配置shell脚本.docx
企业版6.5 Linux 下无线网卡Broadcom Corporation BCM4313 802.11bgn Wireless Network认不到问题解决
我的系统是Fedora6,无线网卡是 Intel 802.11 b/g 的,前段时间为了在 Linux 下可以连接到家中的无线网络,忙活了一个多星期才搞好,感觉还是很麻烦的,所以把我整理的资料发上来大家供大家参考,希望对大家有用。...
intel i225 2.5g 网卡驱动
AR8161 LINUX 网卡驱动,AR8161 LINUX 网卡驱动,AR8161 LINUX 网卡驱动,
Linux 系统 测试网络带宽及网卡吞吐量 shell 脚本 脚本使用了 dd 命令、nc 命令和 iperf 命令来测试 网卡的带宽和吞吐量。您可以根据需要调整脚本的参数,以 获得更准确的测试结果
这是一个linux下的有线网卡驱动。只需自己编译安装即可。
前段时间硬盘安装了CentOS5.5 但台式机用的是无线网卡,其驱动程序没有Linux版的,在此提供 madwifi驱动程序包给需要的朋友
linux 网卡 数量 c 脚本linux 网卡 数量 c 脚本linux 网卡 数量 c 脚本linux 网卡 数量 c 脚本linux 网卡 数量 c 脚本
linux下安装 USB 网卡驱动 说明。
LINUX下安装无线网卡驱动程序
鈺硕 AR8151 Gigabit Ethernet Controller linux下驱动
linux系统cs网卡的驱动程序源代码
Intel无线网卡驱动是一款适用于多型号网卡的驱动程序,用户可以安装此款驱动使用网卡,多型号随意挑选你需要的驱动程序安装,使用,需要的用户就下载吧!Intel网卡驱动简介:intel服务器无线网卡驱动是用于intel网卡...