File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -57,9 +57,27 @@ is_iso_install() {
5757 fi
5858}
5959
60- # Check is port 80 in used (necessary for HTTPS)
60+ # Check if port 80 is in use (necessary for HTTPS)
61+ # Returns IS_PORT_USED=true only if port 80 or 443 is used by something OTHER than our HTTPS container
6162is_port_used () {
62- lsof -i -P -n | grep " :80 (LISTEN)" & > /dev/null && IS_PORT_USED=true || IS_PORT_USED=false
63+ # Check if port 80 or 443 is in use at all
64+ local port80_used port443_used
65+ lsof -i -P -n | grep " :80 (LISTEN)" & > /dev/null && port80_used=true || port80_used=false
66+ lsof -i -P -n | grep " :443 (LISTEN)" & > /dev/null && port443_used=true || port443_used=false
67+
68+ if [ " $port80_used " = false ] && [ " $port443_used " = false ]; then
69+ IS_PORT_USED=false
70+ return
71+ fi
72+
73+ # If either port is in use, check if it's our HTTPS container
74+ if docker ps --format ' {{.Names}}' 2> /dev/null | grep -q " ^DAppNodeCore-https.dnp.dappnode.eth$" ; then
75+ # Port 80 or 443 is used by our HTTPS container, so we consider it "not used" for package determination
76+ IS_PORT_USED=false
77+ else
78+ # Port 80 or 443 is used by something else
79+ IS_PORT_USED=true
80+ fi
6381}
6482
6583# Determine packages to be installed
You can’t perform that action at this time.
0 commit comments