Add usbtesting only script
This commit is contained in:
@@ -127,7 +127,7 @@ then
|
||||
counter=0
|
||||
while [[ -z "$UDEV" ]] && [[ $counter -lt 30 ]]; do
|
||||
UDEV=$(timeout 1s journalctl -kf | sed -n -e 's/^.*SerialNumber: //p')
|
||||
TEMPUSB=$(timeout 1s journalctl -kf | sed -n -e 's/^.*\(cdc_acm\|ftdi_sio\) \([0-9].*[0-9]\): \(tty.*\|FTD.*\).*/\2/p')
|
||||
TEMPUSB=$(timeout 1s journalctl -kf | sed -n -e 's/^.*\(cdc_acm\|ftdi_sio\|ch341\) \([0-9].*[0-9]\): \(tty.*\|FTD.*\|ch341.*\).*/\2/p')
|
||||
counter=$(( $counter + 1 ))
|
||||
done
|
||||
fi
|
||||
|
||||
14
usbtesting.sh
Executable file
14
usbtesting.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
journalctl --rotate > /dev/null 2>&1
|
||||
journalctl --vacuum-time=1seconds > /dev/null 2>&1
|
||||
echo "Plug your printer in via USB now (detection time-out in 1 min)"
|
||||
counter=0
|
||||
while [[ -z "$UDEV" ]] && [[ $counter -lt 30 ]]; do
|
||||
UDEV=$(timeout 1s journalctl -kf | sed -n -e 's/^.*SerialNumber: //p')
|
||||
TEMPUSB=$(timeout 1s journalctl -kf | sed -n -e 's/^.*\(cdc_acm\|ftdi_sio\|ch341\) \([0-9].*[0-9]\): \(tty.*\|FTD.*\|ch341-uart.*\).*/\2/p')
|
||||
counter=$(( $counter + 1 ))
|
||||
if [ -n "$TEMPUSB" ]; then
|
||||
echo $TEMPUSB
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user