summaryrefslogtreecommitdiff
path: root/tools/nc.odroid
blob: b83ad8ca50c57032657555b61db773d0c6a94fff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

boardip=10.10.10.11
hostip=10.10.10.10
interface=usb0
port=6666

echo "Please connect the the OTG port of the Odroid to your host PC"
echo "Power on the Odroid"
echo ""
while [ 1 ];
do
	good=`ifconfig $interface 2> /dev/null | grep $hostip | wc -l`
	if [ "$good" = "1" ];
	then
		echo "Board Connectivity established - Enjoy netconsole over CDC ETH"
		echo "--------------------------------------------------------------"
		break;
	fi
	sleep 1
done

trap "stty icanon echo intr ^C" 0 2 3 5 10 13 15
echo "NOTE: the interrupt signal (normally ^C) has been remapped to ^T"

stty -icanon -echo intr ^T
(
	nc -u -p $port $boardip $port
)
pid=$!
kill ${pid} 2>/dev/null