Skip to content

Commit d2c4e2d

Browse files
committed
Science Commit 5.
1 parent f845968 commit d2c4e2d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/nwe-ports.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ nwe_open_ports() {
9797

9898
# SECURITY: Set NWE_TRUSTED_IP to restrict access to a specific IP.
9999
# Without it, ports are open to ALL sources (0.0.0.0).
100-
if [ -z "$NWE_TRUSTED_IP" ]; then
100+
if [ -z "${NWE_TRUSTED_IP:-}" ]; then
101101
echo "[WARN] NWE_TRUSTED_IP not set — opening ports to ALL sources. Set NWE_TRUSTED_IP for production."
102102
fi
103103

@@ -110,7 +110,7 @@ nwe_open_ports() {
110110
for PORT in "${NWE_PORTS[@]}"; do
111111
if ufw status | grep -q "$PORT/tcp.*ALLOW" 2>/dev/null; then
112112
SKIPPED=$((SKIPPED + 1))
113-
elif [ -n "$NWE_TRUSTED_IP" ]; then
113+
elif [ -n "${NWE_TRUSTED_IP:-}" ]; then
114114
if sudo ufw allow from "$NWE_TRUSTED_IP" to any port "$PORT" proto tcp comment "NWE: $PORT" 2>/dev/null; then
115115
OPENED=$((OPENED + 1))
116116
else

0 commit comments

Comments
 (0)