mirror of
https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git
synced 2025-12-14 19:02:45 +03:00
Improve readability and fix quoting in fake netcat
No functional changes.
This commit is contained in:
parent
11789c272f
commit
abe98e6cbf
14
tests/bin/nc
14
tests/bin/nc
@ -6,11 +6,17 @@ local_port=1024
|
||||
case "$input" in
|
||||
-*) echo "nc: bad input: \$input" >&2; exit 1;;
|
||||
esac
|
||||
while [ ! -z $1 ]; do
|
||||
case $1 in
|
||||
while [ ! -z "$1" ]; do
|
||||
case "$1" in
|
||||
-w) shift 2;;
|
||||
-p) local_port=$2; shift 2;;
|
||||
*) if [ -z $host ]; then host=$1; elif [ -z $port ]; then port=$1; fi; shift 1;;
|
||||
-p) local_port="$2"; shift 2;;
|
||||
*) if [ -z "$host" ]; then
|
||||
host="$1"
|
||||
elif [ -z "$port" ]; then
|
||||
port="$1";
|
||||
fi
|
||||
shift 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user