summaryrefslogtreecommitdiff
path: root/test-cli/test/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'test-cli/test/scripts')
-rw-r--r--test-cli/test/scripts/__init__.py0
-rwxr-xr-xtest-cli/test/scripts/usb.sh14
2 files changed, 14 insertions, 0 deletions
diff --git a/test-cli/test/scripts/__init__.py b/test-cli/test/scripts/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test-cli/test/scripts/__init__.py
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