5 echo "Usage: $0 <board-IP> [board-port [board-in-port]]"
7 echo "If port is not specified, '6666' will be used"
16 while [ -n "$1" ] ; do
20 -*) usage
"Invalid option $1";;
27 board_out_port
=${2:-6666}
28 board_in_port
=${3:-${board_out_port}}
30 echo Board out port
: ${board_out_port}
31 echo Board
in port
: ${board_in_port}
33 if [ -z "${ip}" ] ||
[ -n "$4" ] ; then
34 usage
"Invalid number of arguments"
37 for nc
in netcat nc
; do
38 type ${nc} >/dev
/null
2>&1 && break
41 trap "stty icanon echo intr ^C" 0 2 3 5 10 13 15
42 echo "NOTE: the interrupt signal (normally ^C) has been remapped to ^T"
44 stty
-icanon -echo intr ^T
46 if type ncb
2>/dev
/null
; then
47 # see if ncb is in $PATH
48 exec ncb
${board_out_port}
50 elif [ -x ${0%/*}/ncb
] ; then
51 # maybe it's in the same dir as the netconsole script
52 exec ${0%/*}/ncb
${board_out_port}
55 # blah, just use regular netcat
56 while ${nc} -u -l -p ${board_out_port} < /dev
/null
; do
62 ${nc} -u ${ip} ${board_in_port}
63 kill ${pid} 2>/dev
/null