summaryrefslogtreecommitdiff
path: root/usbreset.sh
blob: ef4529b512eea98c2bd7c80176ee98921af08b8b (plain)
  1. #!/bin/sh
  2. # Unload andd then reload USB drivers, to reset to using sda for new stick
  3. # Try 2.4 and then 2.6 names: uhci/uhci_hcd
  4. usbchain="usbcore ehci-hcd uhci uhci_hcd ohci_hcd scsi_mod usb_storage sd_mod"
  5. usbchain_reverse="$(echo $usbchain | tr '[:space:]' '\n' | tac -)"
  6. for module in $usbchain_reverse; do
  7. modprobe -q -r $module || true
  8. done
  9. for module in $usbchain; do
  10. modprobe -q $module || true
  11. done