mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-10-09 20:32:52 +02:00
use "netstat -an" to prevent IP resolution (#2006)
This commit is contained in:
@@ -75,7 +75,7 @@ if [ "$1" = "status" ]; then
|
|||||||
echo "publicIP='${cleanip}'"
|
echo "publicIP='${cleanip}'"
|
||||||
fi
|
fi
|
||||||
echo "portTCP='50001'"
|
echo "portTCP='50001'"
|
||||||
localPortRunning=$(sudo netstat -a | grep -c '0.0.0.0:50001')
|
localPortRunning=$(sudo netstat -an | grep -c '0.0.0.0:50001')
|
||||||
echo "localTCPPortActive=${localPortRunning}"
|
echo "localTCPPortActive=${localPortRunning}"
|
||||||
|
|
||||||
publicPortRunning=$(nc -z -w6 ${publicip} 50001 2>/dev/null; echo $?)
|
publicPortRunning=$(nc -z -w6 ${publicip} 50001 2>/dev/null; echo $?)
|
||||||
@@ -87,7 +87,7 @@ if [ "$1" = "status" ]; then
|
|||||||
echo "publicTCPPortAnswering=0"
|
echo "publicTCPPortAnswering=0"
|
||||||
fi
|
fi
|
||||||
echo "portHTTP='50002'"
|
echo "portHTTP='50002'"
|
||||||
localPortRunning=$(sudo netstat -a | grep -c '0.0.0.0:50002')
|
localPortRunning=$(sudo netstat -an | grep -c '0.0.0.0:50002')
|
||||||
echo "localHTTPPortActive=${localPortRunning}"
|
echo "localHTTPPortActive=${localPortRunning}"
|
||||||
publicPortRunning=$(nc -z -w6 ${publicip} 50002 2>/dev/null; echo $?)
|
publicPortRunning=$(nc -z -w6 ${publicip} 50002 2>/dev/null; echo $?)
|
||||||
if [ "${publicPortRunning}" == "0" ]; then
|
if [ "${publicPortRunning}" == "0" ]; then
|
||||||
|
Reference in New Issue
Block a user