26 lines · 411 B · Text
RawDownload
#!/bin/rc# usb/probe [-h] - list all usb devices, including hubsrfork etest -e /dev/usb || bind -a '#u' /dev || {	echo no '#u/usb' >[1=2]	exit nousb} filter = catif (~ $1 -h)	filter = (grep -v ' (root)?hub ') awk 'BEGIN	{ ep = "" }$1 ~ /ep[0-9]+\.0/ && $2 == "enabled" && $NF ~ /busy|idle/ {	ep=$1	next}{	if(ep != ""){		printf "%s %s\n", ep, $0		ep = ""	}}' /dev/usb/ctl | $filter exit ''