From: Christian Schmidt Date: Fri, 25 Sep 2009 15:44:08 +0000 (+0200) Subject: Added option to disable ping check for mirrors. X-Git-Tag: v2.9-beta1~719 X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=commitdiff_plain;h=d59b02f177dce0e077da5256eee68d2cf10b2bfd;hp=8c7f7ed444bcab9593ff059f26d6440c5fc8b42f Added option to disable ping check for mirrors. --- diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index 2d6f1c8f96..8f20d57767 100755 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -44,6 +44,7 @@ $pakfiresettings{'INSPAKS'} = ''; $pakfiresettings{'DELPAKS'} = ''; $pakfiresettings{'AUTOUPDATE'} = 'off'; $pakfiresettings{'AUTOUPGRADE'} = 'off'; +$pakfiresettings{'HEALTHCHECK'} = 'on'; $pakfiresettings{'UUID'} = 'on'; sub refreshpage{&Header::openbox( 'Waiting', 1, "" );print "

$Lang::tr{'pagerefresh'}
";&Header::closebox();} @@ -169,6 +170,9 @@ $checked{'AUTOUPDATE'}{$pakfiresettings{'AUTOUPDATE'}} = "checked='checked'"; $checked{'AUTOUPGRADE'}{'off'} = ''; $checked{'AUTOUPGRADE'}{'on'} = ''; $checked{'AUTOUPGRADE'}{$pakfiresettings{'AUTOUPGRADE'}} = "checked='checked'"; +$checked{'HEALTHCHECK'}{'off'} = ''; +$checked{'HEALTHCHECK'}{'on'} = ''; +$checked{'HEALTHCHECK'}{$pakfiresettings{'HEALTHCHECK'}} = "checked='checked'"; $checked{'UUID'}{'off'} = ''; $checked{'UUID'}{'on'} = ''; $checked{'UUID'}{$pakfiresettings{'UUID'}} = "checked='checked'"; @@ -292,6 +296,9 @@ print <$Lang::tr{'pakfire core update auto'} on | off + $Lang::tr{'pakfire health check'} + on | + off $Lang::tr{'pakfire register'} on | off diff --git a/langs/de/cgi-bin/de.pl b/langs/de/cgi-bin/de.pl index ee5743967d..f6226ec080 100644 --- a/langs/de/cgi-bin/de.pl +++ b/langs/de/cgi-bin/de.pl @@ -1292,6 +1292,7 @@ 'pakfire configuration' => 'Pakfire Konfiguration', 'pakfire core update auto' => 'Core und Addon Updates automatisch installieren:', 'pakfire core update level' => 'Core-Update-Level', +'pakfire health check' => 'Mirrors auf Erreichbarkeit prüfen(ping)', 'pakfire install description' => 'Wählen Sie ein oder mehrere Pakete zur Installation aus und drücken Sie auf das plus Symbol.', 'pakfire install package' => 'Sie möchten folgende Pakete installieren: ', 'pakfire installed addons' => 'Installierte Addons:', diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 1fcae040b2..590a68fd54 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -1319,6 +1319,7 @@ 'pakfire configuration' => 'Pakfire Configuration', 'pakfire core update auto' => 'Install core and addon updates automatically:', 'pakfire core update level' => 'Core-Update-Level', +'pakfire health check' => 'Check if mirror is reachable(ping)', 'pakfire install description' => 'Please choose one or more items from the list below and click the plus to install.', 'pakfire install package' => 'You want to install the following packages: ', 'pakfire installed addons' => 'Installed Addons:', diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index 0d8e8af376..d2ad7e34a4 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -324,7 +324,11 @@ sub selectmirror { $proto = $templine[0]; $host = $templine[1]; $path = $templine[2]; - if (pinghost("$host")) { + if ($pakfiresettings{'HEALTHCHECK'} eq "off") { + logger("PING INFO: Healthcheck is disabled"); + $found = 1; + return ($proto, $host, $path); + elsif (pinghost("$host")) { $found = 1; return ($proto, $host, $path); }