mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-21 23:20:23 +00:00
port
This commit is contained in:
parent
02de147a3b
commit
6524e373e5
1 changed files with 11 additions and 4 deletions
|
@ -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 a new issue