Created
October 31, 2019 10:27
-
-
Save isaacgr/740588afcf46c008c98e2f05862741f1 to your computer and use it in GitHub Desktop.
Restart pci interface to fix dual boot ethernet issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Get the PCI-Address of network card (Caution: This works ONLY with ONE NIC) | |
PCI=`/usr/bin/lspci | /bin/egrep -i 'network|ethernet' | /usr/bin/cut -d' ' -f1` | |
PCIPATH=`/usr/bin/find /sys -name *\${PCI} | /bin/egrep -i *pci0000*` | |
#echo "PCI =$PCI" | |
#echo "PCIPATH=$PCIPATH" | |
#ls -la $PCIPATH | |
/usr/bin/logger -t "ResetNIC" "Resetting PCI NIC ${PCIPATH}" | |
#Reset the PCI Device completely (like Power-ON/Off) | |
echo 1 >${PCIPATH}/reset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment