From e4559c79a37b39c28c71ed8411ca99b7544a2e95 Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Tue, 28 Jan 2014 14:50:00 +0530 Subject: [PATCH] Avoid Whitelist IP When User Press Enter --- usr/local/sbin/easyengine | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/usr/local/sbin/easyengine b/usr/local/sbin/easyengine index 8c3028e3..0da21c92 100644 --- a/usr/local/sbin/easyengine +++ b/usr/local/sbin/easyengine @@ -220,15 +220,10 @@ COMMONNGINX() # White List IP Address echo -e "\033[34mEasyEngine (ee) Allow To Access Protected Files By Using Whitelisted IP Address Or HTTP Authentication\e[0m" - IPDETECT=$(w | grep $(echo $SSH_TTY| cut -d'/' -f3,4) | awk '{print($3)}' | grep -v "-") - if [ ! -z $IPDETECT ] + read -p "Enter The IP Address To Whitelist: " WHITELISTIP + if [[ $WHITELISTIP != "" ]] then - read -p "Enter The IP Address To Whitelist: [$IPDETECT]: " WHITELISTIP - if [[ $WHITELISTIP = "" ]] - then - WHITELISTIP=$IPDETECT - fi - sed -i "s/deny.*/$(echo "allow $WHITELISTIP;")\ndeny all;/" /etc/nginx/common/acl.conf + sed -i "s/deny.*/$(echo "allow $WHITELISTIP;")\ndeny all;/" /etc/nginx/common/acl.conf fi # Protect EE Locations