Skip to content

Commit

Permalink
Fixing usb location helper script
Browse files Browse the repository at this point in the history
  • Loading branch information
kiemlicz committed Oct 2, 2023
1 parent 09bf3ac commit 419448a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 0 additions & 12 deletions core/hardware/locate_usb

This file was deleted.

12 changes: 12 additions & 0 deletions core/hardware/usb_functions
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

locate_usb() {
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
}

0 comments on commit 419448a

Please sign in to comment.