File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments