Skip to content

Commit e4559c7

Browse files
committed
Avoid Whitelist IP When User Press Enter
1 parent f85b59f commit e4559c7

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

usr/local/sbin/easyengine

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,10 @@ COMMONNGINX()
220220

221221
# White List IP Address
222222
echo -e "\033[34mEasyEngine (ee) Allow To Access Protected Files By Using Whitelisted IP Address Or HTTP Authentication\e[0m"
223-
IPDETECT=$(w | grep $(echo $SSH_TTY| cut -d'/' -f3,4) | awk '{print($3)}' | grep -v "-")
224-
if [ ! -z $IPDETECT ]
223+
read -p "Enter The IP Address To Whitelist: " WHITELISTIP
224+
if [[ $WHITELISTIP != "" ]]
225225
then
226-
read -p "Enter The IP Address To Whitelist: [$IPDETECT]: " WHITELISTIP
227-
if [[ $WHITELISTIP = "" ]]
228-
then
229-
WHITELISTIP=$IPDETECT
230-
fi
231-
sed -i "s/deny.*/$(echo "allow $WHITELISTIP;")\ndeny all;/" /etc/nginx/common/acl.conf
226+
sed -i "s/deny.*/$(echo "allow $WHITELISTIP;")\ndeny all;/" /etc/nginx/common/acl.conf
232227
fi
233228

234229
# Protect EE Locations

0 commit comments

Comments
 (0)