From d7d667b189559a7e2c5bdfdf2095c8be02c93a69 Mon Sep 17 00:00:00 2001 From: john30 Date: Sat, 17 Sep 2016 16:20:55 +0200 Subject: [PATCH] allow definition of port to connect to --- contrib/scripts/readall.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/scripts/readall.sh b/contrib/scripts/readall.sh index ab409dd2..75c06b27 100755 --- a/contrib/scripts/readall.sh +++ b/contrib/scripts/readall.sh @@ -1,5 +1,11 @@ #!/bin/sh -for i in `echo "f" "$@"|nc localhost 8888|cut -d ' ' -f '1-2'|sed -e 's# #:#'`; do - ret=`echo "r -c" ${i%%:*} ${i##*:}|nc localhost 8888|head -n 1` +port=8888 +if [ "x$1" = "x-p" ]; then + shift + port=$1 + shift +fi +for i in `echo "f" "$@"|nc localhost $port|cut -d ' ' -f '1-2'|sed -e 's# #:#'`; do + ret=`echo "r -c" ${i%%:*} ${i##*:}|nc localhost $port|head -n 1` echo ${i%%:*} ${i##*:} "=" $ret done