From WebUI, 17 Hours ago, written in Bash.
This paste will explode in 6 Hours.
Embed
  1. #!/bin/bash
  2.  
  3. if [[ $EUID != 0 ]] ; then
  4.   echo This must be run as root!
  5.   exit 1
  6. fi
  7.  
  8. for xhci in /sys/bus/pci/drivers/?hci_hcd ; do
  9.  
  10.   if ! cd $xhci ; then
  11.     echo Weird error. Failed to change directory to $xhci
  12.     exit 1
  13.   fi
  14.  
  15.   echo Resetting devices from $xhci...
  16.  
  17.   for i in ????:??:??.? ; do
  18.     echo -n "$i" > unbind
  19.     echo -n "$i" > bind
  20.   done
  21. done
  22.