6 timeout
1 cat < "$port" >/dev
/null
;
7 stty
-F "$port" "$rate" cs8 cread clocal
8 timeout
1 cat < "$port" >/dev
/null
;
10 banner="$(timeout 7 cat < "$port" | tr '\r\n[:cntrl:]' '...' | grep -i '[a-z0-9]' )"
11 [ -n "$banner" ] && echo -e "$port $rate:\t$banner"
12 #echo "$port:$rate:$banner"
14 stty
-F "$port" "$rate" cs8 cread clocal
16 #Windows newlines are fore HP ProCurve Switches...
17 #echo -ne '\x03\r\n\x04\x03\r\n\r\n\r\n' > "$port"
18 echo -ne '\x03\r\n\x04\x03' > "$port"
20 echo -ne '\r\n\r\n\r\n' > "$port"
25 for port
in /dev
/ttyUSB
*; do
26 for rate
in 115200 38400; do
27 #echo -ne "\r$port:$rate: "
28 banner="$(scan_tty "$port" "$rate")";
29 [ -n "$banner" ] && echo "$banner";
30 echo "$banner" |
egrep -i 'linux|root|login|password|user|connect|invalid' >/dev
/null
&& break;
This page took 0.512397 seconds and 4 git commands to generate.