From d59b02f177dce0e077da5256eee68d2cf10b2bfd Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Fri, 25 Sep 2009 17:44:08 +0200 Subject: [PATCH] Added option to disable ping check for mirrors. --- html/cgi-bin/pakfire.cgi | 7 +++++++ langs/de/cgi-bin/de.pl | 1 + langs/en/cgi-bin/en.pl | 1 + src/pakfire/lib/functions.pl | 6 +++++- 4 files changed, 14 insertions(+), 1 deletion(-) 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); } -- 2.39.2