]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - tools/netconsole
Merge branch 'master' of git://git.denx.de/u-boot-mmc
[karo-tx-uboot.git] / tools / netconsole
index 6ef2723f5848a0b7f973067271d9c5bf1150a18a..c8109bb09569ab770aa26be63fad94433b97fc09 100755 (executable)
@@ -39,9 +39,20 @@ echo "NOTE: the interrupt signal (normally ^C) has been remapped to ^T"
 
 stty -icanon -echo intr ^T
 (
-while ${nc} -u -l -p ${port} < /dev/null ; do
-       :
-done
+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}