Fix port scan. Don't send a new line character when scanning.
echo -n "" for clarity instead of cat < /dev/null
This commit is contained in:
parent
69df08bcd2
commit
ccd630ac65
2
quickemu
2
quickemu
@ -87,7 +87,7 @@ function get_port() {
|
||||
local PORT_RANGE=$((PORT_START+$2))
|
||||
local PORT
|
||||
for ((PORT = PORT_START; PORT <= PORT_RANGE; PORT++)); do
|
||||
(cat < /dev/null >/dev/tcp/127.0.0.1/${CANDIDATE}) >/dev/null 2>&1
|
||||
(echo -n "" >/dev/tcp/127.0.0.1/${CANDIDATE}) >/dev/null 2>&1
|
||||
if [ ${?} -ne 0 ]; then
|
||||
echo "${PORT}"
|
||||
break
|
||||
|
Loading…
Reference in New Issue
Block a user