1
0
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:
Natanael Copa 2024-06-27 22:10:24 +02:00
parent 11789c272f
commit abe98e6cbf

View File

@ -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