Skip to content

Commit 963050b

Browse files
committed
Avoid whitelist empty ip address in acl.conf
1 parent 4c7435c commit 963050b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

usr/local/sbin/easyengine

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,11 @@ COMMONNGINX()
219219
EEMD5SUM
220220

221221
# White List IP Address
222-
sed -i "s/deny.*/$(echo "allow $(w | grep $(echo $SSH_TTY| cut -d'/' -f3,4) | awk '{print($3)}');")\ndeny all;/" /etc/nginx/common/acl.conf
222+
WHITELISTIP=$(w | grep $(echo $SSH_TTY| cut -d'/' -f3,4) | awk '{print($3)}')
223+
if [ ! -z $WHITELISTIP ]
224+
then
225+
sed -i "s/deny.*/$(echo "allow $WHITELISTIP;")\ndeny all;/" /etc/nginx/common/acl.conf
226+
fi
223227

224228
# Protect EE Locations
225229
HTTPAUTH

0 commit comments

Comments
 (0)