10 |
# version 0.1.7, no parseable list cmd |
# version 0.1.7, no parseable list cmd |
11 |
if [[ -x /usr/bin/bind_driver ]] |
if [[ -x /usr/bin/bind_driver ]] |
12 |
then |
then |
13 |
BINDCMD="/usr/bin/bind_driver " |
BINDCMD="/usr/bin/bind_driver" |
14 |
else |
else |
15 |
BINDCMD="/usr/sbin/usbip_bind_driver" |
BINDCMD="/usr/sbin/usbip_bind_driver" |
16 |
fi |
fi |
17 |
|
|
18 |
while true |
while true |
19 |
do |
do |
20 |
# version 0.1.7, no parseable list cmd |
# version =<0.1.7 has no parseable list cmd |
21 |
if [[ ${BINDCMD} = /usr/bin/bind_driver ]] |
if [[ -z $(${BINDCMD} --help | grep -- --list2) ]] |
22 |
then |
then |
23 |
BUSID=$(${BINDCMD} --list | grep -i "${USBIP_DEVICE_ID}" | sed 's:.*busid\ \([0-9].*\)\ (.*:\1:') # sanitizing syntax-highlighting ) |
BUSID=$(${BINDCMD} --list | grep -i "${USBIP_DEVICE_ID}" | sed 's:.*busid\ \([0-9].*\)\ (.*:\1:') # sanitizing syntax-highlighting ) |
24 |
BUSBINDING=$(${BINDCMD} --list | grep -A1 "${USBIP_DEVICE_ID}" | grep -- '->' | sed 's:.*->\ \(.*\):\1:') |
BUSBINDING=$(${BINDCMD} --list | grep -A1 "${USBIP_DEVICE_ID}" | grep -- '->' | sed 's:.*->\ \(.*\):\1:') |
25 |
else |
else |
26 |
BUSID=$(${BINDCMD} --list | grep "${USBIP_DEVICE_ID}" | cut -d'#' -f1 | sed 's:.*=\(.*\):\1:') |
BUSID=$(${BINDCMD} --list2 | grep "${USBIP_DEVICE_ID}" | cut -d'#' -f1 | sed 's:.*=\(.*\):\1:') |
27 |
BUSBINDING=$(${BINDCMD} --list | grep "${USBIP_DEVICE_ID}" | cut -d'#' -f3 | sed 's:.*=\(.*\):\1:') |
BUSBINDING=$(${BINDCMD} --list2 | grep "${USBIP_DEVICE_ID}" | cut -d'#' -f3 | sed 's:.*=\(.*\):\1:') |
28 |
fi |
fi |
29 |
|
|
30 |
if [[ -n ${BUSID} ]] |
if [[ -n ${BUSID} ]] |