#!/bin/bash if [ -z "$1" ]; then echo "Usage: $0 \" echo " i.e. $0 eth0" exit 1 fi if ! ifconfig $1 > /dev/null; then exit 1 fi dev=$(ethtool -e $1 | grep 0x0010 | awk '{print "0x"$13$12$15$14}') case $dev in 0x109a8086) echo "$1: is a \"82573L Gigabit Ethernet Controller\"" ;; *) echo "No appropriate hardware found for this fixup" exit 1 ;; esac echo "This fixup is applicable to your hardware" var=$(ethtool -e $1 | grep 0x0020 | awk '{print $17}') new1=$(echo ${var:0:1} | tr '2367abef' '014589cd') new2=$(echo ${var:1}) new=$new1$new2 if [ ${var:0:1}${var:1} == $new ]; then echo "Your eeprom is up to date, no changes were made" exit 2 fi echo "executing command: ethtool -E $1 magic $dev offset 0x2f value 0x$new" ethtool -E $1 magic $dev offset 0x2f value 0x$new echo "Please reboot for the change to take effect."