mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-02-02 17:08:38 +08:00
port
This commit is contained in:
parent
6524e373e5
commit
29924ad1be
@ -105,9 +105,14 @@ check_ports() {
|
||||
local ports=("$@")
|
||||
|
||||
for port in "${ports[@]}"; do
|
||||
if netstat -tuln | grep ":$port " >/dev/null; then
|
||||
echo "Port $port is in use, install failed"
|
||||
exit
|
||||
if [[ $port =~ ^[0-9]+$ ]] && [ $port -ge 0 ] && [ $port -le 65535 ]; then
|
||||
if netstat -tuln | grep ":$port " >/dev/null; then
|
||||
echo "Port $port is in use, install failed"
|
||||
exit
|
||||
fi
|
||||
else
|
||||
echo "Invalid port: $port"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user