mirror of
https://github.com/Websoft9/websoft9.git
synced 2025-01-23 09:20:20 +08:00
port
This commit is contained in:
parent
02de147a3b
commit
6524e373e5
@ -243,12 +243,19 @@ check_ports() {
|
||||
|
||||
echo "Stop Websoft9 Proxy and Cockpit service for reserve ports..."
|
||||
sudo docker stop websoft9-proxy 2>/dev/null || echo "docker stop websoft9-proxy not need "
|
||||
|
||||
|
||||
for port in "${ports[@]}"; do
|
||||
if ss -tuln | grep ":$port " >/dev/null && ! systemctl status cockpit.socket | grep "$port" >/dev/null; then
|
||||
echo "Port $port is in use or not in cockpit.socket, install failed"
|
||||
exit
|
||||
|
||||
if [[ $port =~ ^[0-9]+$ ]] && [ $port -ge 0 ] && [ $port -le 65535 ]; then
|
||||
if ss -tuln | grep ":$port " >/dev/null && ! systemctl status cockpit.socket | grep "$port" >/dev/null; then
|
||||
echo "Port $port is in use or not in cockpit.socket, install failed"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Invalid port: $port"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
echo "All ports are available"
|
||||
|
Loading…
Reference in New Issue
Block a user