Last active
August 29, 2015 14:26
-
-
Save mindnuts/3b51a212989d9c3644da to your computer and use it in GitHub Desktop.
This file contains hidden or 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/sh | |
| if [ "$(id -u)" != 0 ] ; then | |
| echo This must be run as root! | |
| exit 1 | |
| fi | |
| # | |
| # Look for the most comment cases | |
| # | |
| for driver in xhci_hcd ehci_hcd uhci_hcd ; do | |
| # | |
| # The directory to operate within | |
| # | |
| dir=/sys/bus/pci/drivers/${driver} | |
| # | |
| # If it exists we have the appropriate USB-driver | |
| # | |
| if [ -d $dir ]; then | |
| echo "Reseting: ${driver}" | |
| cd ${dir} | |
| for dev_id in ????:??:??.? ; do | |
| printf "${dev_id}" > unbind | |
| printf "${dev_id}" > bind | |
| done | |
| else | |
| echo "Not present: ${driver}" | |
| fi | |
| done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment