external IP detection fix

dev
bedefaced 8 years ago
parent c3667633ad
commit 6242f4b43c
  1. 2
      ipsec/env.sh
  2. 2
      openvpn/env.sh
  3. 2
      pptp/env.sh

@ -44,7 +44,7 @@ LOCALMASK="/24"
LOCALIPMASK="$LOCALIP$LOCALMASK"
IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '(127|10|100|172|192)\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
if [[ "$IP" = "" ]]; then
IP=$(wget -4qO- "http://whatismyip.akamai.com/")
fi

@ -42,7 +42,7 @@ LOCALMASK="/24"
LOCALIPMASK="$LOCALIP$LOCALMASK"
IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '(127|10|100|172|192)\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
if [[ "$IP" = "" ]]; then
IP=$(wget -4qO- "http://whatismyip.akamai.com/")
fi

@ -37,7 +37,7 @@ LOCALMASK="/24"
LOCALIPMASK="$LOCALIP$LOCALMASK"
IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '(127|10|100|172|192)\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
if [[ "$IP" = "" ]]; then
IP=$(wget -4qO- "http://whatismyip.akamai.com/")
fi

Loading…
Cancel
Save