Corrected dhcp.cgi sorting issue

Fixed T-Online not responding to ping requests
This commit is contained in:
Michael Tremer
2008-07-25 21:00:51 +00:00
parent 9fc9a4d037
commit cab84d3ab8
3 changed files with 13 additions and 4 deletions

View File

@@ -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/