diff options
author | Manel Caro <mcaro@iseebcn.com> | 2020-03-04 17:46:36 +0100 |
---|---|---|
committer | Manel Caro <mcaro@iseebcn.com> | 2020-03-04 17:46:36 +0100 |
commit | 09de774dcc1a5abc1c8f3a00fdb039aa3c522f52 (patch) | |
tree | c4bd3963d0df01d2e3a33732247388ed4651b186 /test-cli/test/helpers/usb.sh | |
parent | b6932fbaf898724ae87c29f8965621610f377084 (diff) | |
download | board-09de774dcc1a5abc1c8f3a00fdb039aa3c522f52.zip board-09de774dcc1a5abc1c8f3a00fdb039aa3c522f52.tar.gz board-09de774dcc1a5abc1c8f3a00fdb039aa3c522f52.tar.bz2 |
SOPA Initial Commit
Diffstat (limited to 'test-cli/test/helpers/usb.sh')
-rwxr-xr-x | test-cli/test/helpers/usb.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test-cli/test/helpers/usb.sh b/test-cli/test/helpers/usb.sh new file mode 100755 index 0000000..c8e6924 --- /dev/null +++ b/test-cli/test/helpers/usb.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do + ( + syspath="${sysdevpath%/dev}" + devname="$(udevadm info -q name -p $syspath)" + [[ "$devname" == "bus/"* ]] && continue + eval "$(udevadm info -q property --export -p $syspath)" + [[ -z "$ID_SERIAL" ]] && continue + echo "/dev/$devname - $ID_SERIAL" + ) +done + +return 0 |