mirror of
https://gitlab.com/fscarmen/warp.git
synced 2026-06-15 03:25:42 +08:00
Fix a bug in input port
Former-commit-id: a4e301082d242f3cc7fca105f3eeb8c39848d34b
This commit is contained in:
@@ -1070,6 +1070,7 @@ input_port() {
|
||||
i=5
|
||||
PORT=40000
|
||||
ss -nltp | grep -q ":$PORT"[[:space:]] && reading " $(text_eval 103) " PORT || reading " $(text 104) " PORT
|
||||
PORT=${PORT:-'40000'}
|
||||
until grep -qE "^[1-9][0-9]{3,4}$" <<< $PORT && [[ "$PORT" -ge 1000 && "$PORT" -le 65535 ]] && [[ ! $(ss -nltp) =~ :"$PORT"[[:space:]] ]]; do
|
||||
(( i-- )) || true
|
||||
[[ $i = 0 ]] && error " $(text 29) "
|
||||
@@ -1078,9 +1079,11 @@ input_port() {
|
||||
[[ $(ss -nltp) =~ :"$PORT"[[:space:]] ]] && reading " $(text_eval 103) " PORT
|
||||
else
|
||||
reading " $(text_eval 111) " PORT
|
||||
PORT=${PORT:-'40000'}
|
||||
fi
|
||||
else
|
||||
reading " $(text_eval 111) " PORT
|
||||
PORT=${PORT:-'40000'}
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user