Skip to content

Instantly share code, notes, and snippets.

@culli
Last active January 11, 2024 22:12
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 culli/bb0ce41bd90409363bfbbde5c7bae569 to your computer and use it in GitHub Desktop.
Save culli/bb0ce41bd90409363bfbbde5c7bae569 to your computer and use it in GitHub Desktop.
Ivanky usb hub restart ethernet without unplugging or rebooting. https://xkcd.com/1205/
#! /bin/bash
# Good day to the one other random person that might find this!
# This one trick can save you literal __minutes__ in your week. Minutes I say!
#
# My Ivanky hub's ethernet stops working (probably when the machine sleeps)
# and shows as disconnected in System/Network. I often have to reset its power,
# unplug its usb from the mac, or even restart the mac.
#
# So far the solution here is working by just running this script. Ivanky does
# have updated drivers available, but that didn't help.
#
# See: https://apple.stackexchange.com/a/321009/90357
#
# Download USB Prober (used to come with XCode)
# Just running USB Prober might reset the usb port you're having trouble with.
# If not, find the Device VendorID and ProductID in USB Prober.
# Put those in copies of the command below for as many as you need to reset
# For example, my Ivanky hub has a Realtek USB LAN with:
# "Device VendorID/ProductID: 0x0BDA/0x8153 (Realtek Semiconductor Corp.)"
# Update the path to USB Prober in the command
# Don't forget to give this script execute permissions: `chmod +x reset-usb.sh`
# reset usb ethernet
/Applications/USB\ Prober.app/Contents/Resources/reenumerate -v 0x0BDA,0x8153
# reset mouse
/Applications/USB\ Prober.app/Contents/Resources/reenumerate -v 0x046D,0xC07E
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment