]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - config/updxlrator/updxlrator
Fix dns dhcp client helper script.
[people/pmueller/ipfire-2.x.git] / config / updxlrator / updxlrator
index c1408a2123b31d5403c7af0d647005c57dc369cb..7f44ff76df2d2a5f226cf92a232734c67260e265 100644 (file)
@@ -2,9 +2,11 @@
 #
 # This code is distributed under the terms of the GPL
 #
-# (c) 2006-2008 marco.s - http://update-accelerator.advproxy.net
+# (c) 2006-2009 marco.s - http://update-accelerator.advproxy.net
 #
-# $Id: updxlrator,v 2.0 2008/04/06 00:00:00 marco.s Exp $
+# Portions (c) 2008 by dotzball - http://www.blockouttraffic.de
+#
+# $Id: updxlrator,v 2.1 2009/01/10 00:00:00 marco.s Exp $
 #
 
 use strict;
@@ -16,7 +18,7 @@ my $swroot="/var/ipfire";
 my $updcachedir="/var/updatecache";
 my $apphome="/var/ipfire/updatexlrator";
 my $logfile="/var/log/updatexlrator/cache.log";
-my $wget="$apphome/bin/wget";
+my $wget="/usr/bin/wget";
 my $debug=(-e "$apphome/debug");
 my $http_port='81';
 my %netsettings=();
@@ -48,6 +50,8 @@ if (-e "$swroot/updatexlrator/settings")
 }
 if (!$maxusage) { $maxusage=75; };
 
+# dotzball: check for dead downloads
+system("$apphome/bin/checkdeaddl &");
 
 while (<>) {
 
@@ -130,7 +134,7 @@ while (<>) {
        # -----------------------------------------------------------
 
        if (
-           (($source_url =~ m@^http://swcdn\.apple\.com/content/downloads/.*\.(tar)$@i) ||
+            (($source_url =~ m@^http://swcdn\.apple\.com/content/downloads/.*\.(tar|pkg)$@i) ||
             ($source_url =~ m@^http://appldnld\.apple\.com\.edgesuite\.net/.*\.(exe|dmg)$@i) ||
             ($source_url =~ m@^http://.*\.g.akamai.net/.*/3093/1/.*\.(tar|pkg|dmg|exe)$@i))
           )
@@ -173,10 +177,10 @@ while (<>) {
        # Section: AVG Downloads
        # -----------------------------------------------------------
 
-       if ($source_url =~ m@^http://[^/]*\.(grisoft|avg)\.com/.*\.(bin)$@i)
-       {
-               $xlrator_url = &check_cache($source_url,$hostaddr,$username,"AVG",$mirror);
-       }
+#      if ($source_url =~ m@^http://[^/]*\.(grisoft|avg)\.com/.*\.(bin)$@i)
+#      {
+#              $xlrator_url = &check_cache($source_url,$hostaddr,$username,"AVG",$mirror);
+#      }
 
        $request="$xlrator_url $hostaddr $username $method\n";
 
@@ -361,7 +365,6 @@ sub check_cache
                &debuglog("File exists in cache and is up to date");
                &debuglog("Retrieving file from cache ($updsource)");
                &setcachestatus("$updcachedir/$vendorid/$uuid/access.log",time);
-               system("chown nobody.squid $vendorid/$uuid/access.log");
                $cacheurl="http://$netsettings{'GREEN_ADDRESS'}:$http_port/updatecache/$vendorid/$uuid/$updfile";
        }
                else