Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# My raspberry pi 5 is constantly disconnecting the USB hardrive after a few hours with nothing really showing in the logs
# so i created this script to check to see if it's still showing, and if not reset the hub and authorization and then remount all drives
#You need to use lsusb or usb-devices to find the Vendor and prod ids usually like 152d:0580 or Vendor=152d ProdID=0580
#You'll also need uhubctl installed to to toggle power to the hubs
## use this command to download it, set it and add it to the crontab
##