
Originally Posted by
iamgnat
Unless there is something else you are doing with USB Watchdog, you could have it watch the Hub itself.
that's what I did in the end, because I was too lazy to play around with the IOKit :-)
So I wrote a simple script:
Code:
#!/bin/sh
while [ 1 ]
do
ioreg | grep -c USBHub
sleep 1
done
which runs in the background and every second reports the number of connected USB hubs. The "correct" number is set in the preferences of the watchdog and the sleep action is triggered whenever the watchdog detects hub removal.
Bookmarks