Browse Source

Avoid Whitelist IP When User Press Enter

old-stable
Mitesh Shah 11 years ago
parent
commit
e4559c79a3
  1. 11
      usr/local/sbin/easyengine

11
usr/local/sbin/easyengine

@ -220,15 +220,10 @@ COMMONNGINX()
# White List IP Address # White List IP Address
echo -e "\033[34mEasyEngine (ee) Allow To Access Protected Files By Using Whitelisted IP Address Or HTTP Authentication\e[0m" 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 "-") read -p "Enter The IP Address To Whitelist: " WHITELISTIP
if [ ! -z $IPDETECT ] if [[ $WHITELISTIP != "" ]]
then then
read -p "Enter The IP Address To Whitelist: [$IPDETECT]: " WHITELISTIP sed -i "s/deny.*/$(echo "allow $WHITELISTIP;")\ndeny all;/" /etc/nginx/common/acl.conf
if [[ $WHITELISTIP = "" ]]
then
WHITELISTIP=$IPDETECT
fi
sed -i "s/deny.*/$(echo "allow $WHITELISTIP;")\ndeny all;/" /etc/nginx/common/acl.conf
fi fi
# Protect EE Locations # Protect EE Locations

Loading…
Cancel
Save