Created
July 25, 2017 12:17
-
-
Save sora/4b6b5dd1d90c81b211cb47bcd29334a5 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/bash | |
set -eu | |
Path=/sys/bus/pci/devices | |
DevList=`ls /sys/bus/pci/devices/` | |
Vender_id="0x8086" | |
Device_id="0x1563" # Intel x550 | |
for devno in ${DevList}; do | |
venid=`cat ${Path}/${devno}/vendor` | |
devid=`cat ${Path}/${devno}/device` | |
if [ ${venid} = ${Vender_id} ] && [ ${devid} = ${Device_id} ]; then | |
echo 1 > ${Path}/${devno}/remove | |
sleep 1 | |
echo 1 > /sys/bus/pci/rescan | |
echo "Rescan: Success." | |
exit 1 | |
fi | |
done | |
echo "Rescan: Failed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment