X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=src%2Fppp%2Fip-up;h=25ac2b96e35cf7a7a7402dda35f5693218e8f35d;hp=af5dd2908f912768fa4f1755d0f738b0ac95ba6f;hb=f85d3836a08ffbcc0c2f4b93207ac95ce0d117f2;hpb=a68a74cb3b55fde08877910992a62bc01ce693c7 diff --git a/src/ppp/ip-up b/src/ppp/ip-up index af5dd2908..25ac2b96e 100644 --- a/src/ppp/ip-up +++ b/src/ppp/ip-up @@ -57,13 +57,15 @@ if [ "$TEST" == " 2 packets received" ]; then echo "$5 gateway" >> /tmp/hosts else #no answer - FIRE=`nslookup ping.ipfire.org | tail -2 | head -1 | cut -d" " -f2`; - if [ "$FIRE" == "server" ]; then - #DNS lookup failed use direct ip - echo "85.88.28.124 gateway" >> /tmp/hosts - else + HOST=`host ping.ipfire.org`; + FIRE=`echo $HOST | cut -d" " -f4`; + CHK=`echo $HOST | cut -d" " -f3`; + if [ "$CHK" == "address" ]; then #use ping.ipfire.org echo "$FIRE gateway" >> /tmp/hosts + else + #DNS lookup failed use direct ip + echo "85.88.28.124 gateway" >> /tmp/hosts fi fi mv /tmp/hosts /etc/hosts