X-Git-Url: http://git.ipfire.org/?p=people%2Fteissler%2Fipfire-2.x.git;a=blobdiff_plain;f=src%2Fppp%2Fip-up;fp=src%2Fppp%2Fip-up;h=80fb49f49e1c2a5176860545535f03db5cd403af;hp=0f32820c08c390140423e95ec49672d2ea877a75;hb=cab84d3ab808d54c68310e5f5bdce04e677fafe1;hpb=9fc9a4d037d7e8249a75117089a982f3683addf5 diff --git a/src/ppp/ip-up b/src/ppp/ip-up index 0f32820c0..80fb49f49 100644 --- a/src/ppp/ip-up +++ b/src/ppp/ip-up @@ -44,9 +44,17 @@ echo -n "$1" > /var/ipfire/red/iface echo -n "$4" > /var/ipfire/red/local-ipaddress echo -n "$5" > /var/ipfire/red/remote-ipaddress grep -v "gateway" /etc/hosts > /tmp/hosts -echo "$5 gateway" >> /tmp/hosts -mv /tmp/hosts /etc/hosts +TEST=`ping -c 2 $5 2>/dev/null | tail -2 | head -1 | cut -d"," -f2`; + +if [ "$TEST" == " 2 packets received" ]; then + echo "$5 gateway" >> /tmp/hosts +else + FIRE=`nslookup ping.ipfire.org | tail -2 | head -1 | cut -d" " -f2`; + echo "$FIRE gateway" >> /tmp/hosts +fi + +mv /tmp/hosts /etc/hosts touch /var/ipfire/red/active run_subdir ${rc_base}/init.d/networking/red.up/