Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/rc
2
# usb/probe [-h] - list all usb devices, including hubs
3
rfork e
4
test -e /dev/usb || bind -a '#u' /dev || {
5
	echo no '#u/usb' >[1=2]
6
	exit nousb
7
}
8
 
9
filter = cat
10
if (~ $1 -h)
11
	filter = (grep -v ' (root)?hub ')
12
 
13
awk 'BEGIN	{ ep = "" }
14
$1 ~ /ep[0-9]+\.0/ && $2 == "enabled" && $NF ~ /busy|idle/ {
15
	ep=$1
16
	next
17
}
18
{
19
	if(ep != ""){
20
		printf "%s %s\n", ep, $0
21
		ep = ""
22
	}
23
}
24
' /dev/usb/ctl | $filter
25
 
26
exit ''