mirror of
https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git
synced 2025-12-15 11:22:43 +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
|
case "$input" in
|
||||||
-*) echo "nc: bad input: \$input" >&2; exit 1;;
|
-*) echo "nc: bad input: \$input" >&2; exit 1;;
|
||||||
esac
|
esac
|
||||||
while [ ! -z $1 ]; do
|
while [ ! -z "$1" ]; do
|
||||||
case $1 in
|
case "$1" in
|
||||||
-w) shift 2;;
|
-w) shift 2;;
|
||||||
-p) local_port=$2; shift 2;;
|
-p) local_port="$2"; shift 2;;
|
||||||
*) if [ -z $host ]; then host=$1; elif [ -z $port ]; then port=$1; fi; shift 1;;
|
*) if [ -z "$host" ]; then
|
||||||
|
host="$1"
|
||||||
|
elif [ -z "$port" ]; then
|
||||||
|
port="$1";
|
||||||
|
fi
|
||||||
|
shift 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user