Skip to content

Instantly share code, notes, and snippets.

@robbyoconnor
Created October 3, 2014 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robbyoconnor/b94252a81907ab411a91 to your computer and use it in GitHub Desktop.
Save robbyoconnor/b94252a81907ab411a91 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [[ $EUID != 0 ]] ; then
echo This must be run as root!
exit 1
fi
for xhci in /sys/bus/pci/drivers/?hci_hcd ; do
if ! cd $xhci ; then
echo Weird error. Failed to change directory to $xhci
exit 1
fi
echo Resetting devices from $xhci...
for i in ????:??:??.? ; do
echo -n "$i" > unbind
echo -n "$i" > bind
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment