From cab84d3ab808d54c68310e5f5bdce04e677fafe1 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 25 Jul 2008 21:00:51 +0000 Subject: [PATCH] Corrected dhcp.cgi sorting issue Fixed T-Online not responding to ping requests --- config/cfgroot/header.pl | 4 ++-- config/rootfiles/updater/filelists/core15 | 1 + src/ppp/ip-up | 12 ++++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/config/cfgroot/header.pl b/config/cfgroot/header.pl index e309817781..3a2c932e32 100644 --- a/config/cfgroot/header.pl +++ b/config/cfgroot/header.pl @@ -353,7 +353,7 @@ sub CheckSortOrder { #Sorting of allocated leases if ($ENV{'QUERY_STRING'} =~ /^IPADDR|^ETHER|^HOSTNAME|^ENDTIME/ ) { my $newsort=$ENV{'QUERY_STRING'}; - &readhash("${swroot}/dhcp/settings", \%dhcpsettings); + &General::readhash("${swroot}/dhcp/settings", \%dhcpsettings); $act=$dhcpsettings{'SORT_LEASELIST'}; #Reverse actual ? if ($act =~ $newsort) { @@ -362,7 +362,7 @@ sub CheckSortOrder { }; $dhcpsettings{'SORT_LEASELIST'}=$newsort; - &writehash("${swroot}/dhcp/settings", \%dhcpsettings); + &General::writehash("${swroot}/dhcp/settings", \%dhcpsettings); $dhcpsettings{'ACTION'} = 'SORT'; # avoid the next test "First lauch" } diff --git a/config/rootfiles/updater/filelists/core15 b/config/rootfiles/updater/filelists/core15 index f4ec6e1fc4..8fdea808df 100644 --- a/config/rootfiles/updater/filelists/core15 +++ b/config/rootfiles/updater/filelists/core15 @@ -12,6 +12,7 @@ srv/web/ipfire/cgi-bin/graphs.cgi srv/web/ipfire/cgi-bin/outgoingfw.cgi var/ipfire/langs var/ipfire/graphs.pl +var/ipfire/header.pl var/ipfire/outgoing/bin/outgoingfw.pl var/ipfire/urlfilter/autoupdate/autoupdate.urls usr/share/terminfo/x/xterm-color diff --git a/src/ppp/ip-up b/src/ppp/ip-up index 0f32820c08..80fb49f49e 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/ -- 2.39.2