summaryrefslogtreecommitdiff
path: root/test-cli/test/scripts/usb.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test-cli/test/scripts/usb.sh')
-rwxr-xr-xtest-cli/test/scripts/usb.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/test-cli/test/scripts/usb.sh b/test-cli/test/scripts/usb.sh
new file mode 100755
index 0000000..52ea4b2
--- /dev/null
+++ b/test-cli/test/scripts/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
+
+exit 0