X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tools%2Fnetconsole;h=c8109bb09569ab770aa26be63fad94433b97fc09;hb=6052cbab40e927f94bcb034f1b4c76a18d6729e1;hp=09c89816829f6d1672e6bd746fb5555b586f286d;hpb=8e9c63b40059e81b870685b54d99589152c5b750;p=u-boot diff --git a/tools/netconsole b/tools/netconsole index 09c8981682..c8109bb095 100755 --- a/tools/netconsole +++ b/tools/netconsole @@ -31,12 +31,29 @@ if [ -z "${ip}" ] || [ -n "$3" ] ; then fi for nc in netcat nc ; do - type ${nc} >/dev/null && break + type ${nc} >/dev/null 2>&1 && break 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 -l -p ${port} < /dev/null & -exec ${nc} -u ${ip} ${port} +( +if type ncb 2>/dev/null ; then + # see if ncb is in $PATH + exec ncb ${port} + +elif [ -x ${0%/*}/ncb ] ; then + # maybe it's in the same dir as the netconsole script + exec ${0%/*}/ncb ${port} + +else + # blah, just use regular netcat + while ${nc} -u -l -p ${port} < /dev/null ; do + : + done +fi +) & +pid=$! +${nc} -u ${ip} ${port} +kill ${pid} 2>/dev/null