From 419448aa838fb9277e636477e5a768989ed0bee3 Mon Sep 17 00:00:00 2001 From: stanislaw_jakiel Date: Mon, 2 Oct 2023 19:30:08 +0200 Subject: [PATCH] Fixing usb location helper script --- core/hardware/locate_usb | 12 ------------ core/hardware/usb_functions | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) delete mode 100755 core/hardware/locate_usb create mode 100755 core/hardware/usb_functions diff --git a/core/hardware/locate_usb b/core/hardware/locate_usb deleted file mode 100755 index f31a450..0000000 --- a/core/hardware/locate_usb +++ /dev/null @@ -1,12 +0,0 @@ -#!/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 diff --git a/core/hardware/usb_functions b/core/hardware/usb_functions new file mode 100755 index 0000000..de64c46 --- /dev/null +++ b/core/hardware/usb_functions @@ -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 +}