]>
git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - html/cgi-bin/updatexlrator.cgi
3 # This code is distributed under the terms of the GPL
5 # (c) 2006-2008 marco.s - http://update-accelerator.advproxy.net
7 # Portions (c) 2008 by dotzball - http://www.blockouttraffic.de
9 # $Id: updatexlrator.cgi,v 2.1.0 2008/07/16 00:00:00 marco.s Exp $
11 ###############################################################################
13 # IPFire.org - A linux based firewall #
14 # Copyright (C) 2005-2010 IPFire Team #
16 # This program is free software: you can redistribute it and/or modify #
17 # it under the terms of the GNU General Public License as published by #
18 # the Free Software Foundation, either version 3 of the License, or #
19 # (at your option) any later version. #
21 # This program is distributed in the hope that it will be useful, #
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
24 # GNU General Public License for more details. #
26 # You should have received a copy of the GNU General Public License #
27 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
29 ###############################################################################
33 # enable only the following on debugging purpose
34 #use warnings; no warnings 'once';# 'redefine', 'uninitialized';
35 #use CGI::Carp 'fatalsToBrowser';
39 require '/var/ipfire/general-functions.pl';
40 require "${General::swroot}/lang.pl";
41 require "${General::swroot}/header.pl";
49 my %xlratorsettings=();
77 my $repository = "/var/updatecache/";
78 my $hintcolour = '#FFFFCC';
79 my $colourgray = '#808080';
86 my $not_accessed_last='';
90 my @repositorylist=();
91 my @repositoryfiles=();
97 &General
::readhash
("${General::swroot}/ethernet/settings", \
%netsettings);
98 &General
::readhash
("${General::swroot}/main/settings", \
%mainsettings);
99 &General
::readhash
("${General::swroot}/proxy/settings", \
%proxysettings);
100 &General
::readhash
("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \
%color);
102 $xlratorsettings{'ACTION'} = '';
103 $xlratorsettings{'ENABLE_LOG'} = 'off';
104 $xlratorsettings{'PASSIVE_MODE'} = 'off';
105 $xlratorsettings{'MAX_DISK_USAGE'} = '75';
106 $xlratorsettings{'LOW_DOWNLOAD_PRIORITY'} = 'off';
107 $xlratorsettings{'MAX_DOWNLOAD_RATE'} = '';
108 $xlratorsettings{'ENABLE_AUTOCHECK'} = 'off';
109 $xlratorsettings{'FULL_AUTOSYNC'} = 'off';
110 $xlratorsettings{'NOT_ACCESSED_LAST'} = 'month1';
111 $xlratorsettings{'REMOVE_NOSOURCE'} = 'off';
112 $xlratorsettings{'REMOVE_OUTDATED'} = 'off';
113 $xlratorsettings{'REMOVE_OBSOLETE'} = 'off';
115 &Header
::getcgihash
(\
%xlratorsettings);
117 $xlratorsettings{'EXTENDED_GUI'} = '';
119 if ($xlratorsettings{'ACTION'} eq "$Lang::tr{'updxlrtr statistics'} >>")
121 $xlratorsettings{'EXTENDED_GUI'} = 'statistics';
124 if ($xlratorsettings{'ACTION'} eq "$Lang::tr{'updxlrtr maintenance'} >>")
126 $xlratorsettings{'EXTENDED_GUI'} = 'maintenance';
129 if ($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr purge'})
131 $xlratorsettings{'EXTENDED_GUI'} = 'maintenance';
133 if (($xlratorsettings{'REMOVE_OBSOLETE'} eq 'on') || ($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') || ($xlratorsettings{'REMOVE_OUTDATED'} eq 'on'))
136 undef @repositoryfiles;
137 foreach (<$repository/*>)
141 unless (/^$repository\/download
$/) { push(@sources,$_); }
148 $vendorid = substr($_,rindex($_,"/")+1);
151 $uuid = substr($_,rindex($_,"/")+1);
152 if (-e
"$_/source.url")
154 open (FILE
,"$_/source.url");
158 $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl));
159 $updatefile = "$vendorid/$uuid/$updatefile";
160 push(@repositoryfiles,$updatefile);
165 foreach (@repositoryfiles)
167 ($vendorid,$uuid,$updatefile) = split('/');
169 if (-e
"$repository/$vendorid/$uuid/status")
171 open (FILE
,"$repository/$vendorid/$uuid/status");
175 $status = $metadata[-1];
178 if (-e
"$repository/$vendorid/$uuid/access.log")
180 open (FILE
,"$repository/$vendorid/$uuid/access.log");
184 $lastaccess = $metadata[-1];
187 if (($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') && ($status == $sfNoSource))
189 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
191 if (($xlratorsettings{'REMOVE_OUTDATED'} eq 'on') && ($status == $sfOutdated))
193 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
195 if ($xlratorsettings{'REMOVE_OBSOLETE'} eq 'on')
197 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'week') && ($lastaccess < (time - 604800)))
199 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
201 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month1') && ($lastaccess < (time - 2505600)))
203 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
205 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month3') && ($lastaccess < (time - 7516800)))
207 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
209 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month6') && ($lastaccess < (time - 15033600)))
211 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
213 if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'year') && ($lastaccess < (time - 31536000)))
215 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
222 if ($xlratorsettings{'ACTION'} eq $Lang::tr
{'save'})
224 if (!($xlratorsettings{'MAX_DISK_USAGE'} =~ /^\d+$/) || ($xlratorsettings{'MAX_DISK_USAGE'} < 1) || ($xlratorsettings{'MAX_DISK_USAGE'} > 100))
226 $errormessage = $Lang::tr
{'updxlrtr invalid disk usage'};
229 if (($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') && ((!($xlratorsettings{'MAX_DOWNLOAD_RATE'} =~ /^\d+$/)) || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} < 1)))
231 $errormessage = $Lang::tr
{'updxlrtr invalid download rate'};
238 if ($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr save and restart'})
240 if (!($xlratorsettings{'MAX_DISK_USAGE'} =~ /^\d+$/) || ($xlratorsettings{'MAX_DISK_USAGE'} < 1) || ($xlratorsettings{'MAX_DISK_USAGE'} > 100))
242 $errormessage = $Lang::tr
{'updxlrtr invalid disk usage'};
245 if (($xlratorsettings{'MAX_DOWNLOAD_RATE'} ne '') && ((!($xlratorsettings{'MAX_DOWNLOAD_RATE'} =~ /^\d+$/)) || ($xlratorsettings{'MAX_DOWNLOAD_RATE'} < 1)))
247 $errormessage = $Lang::tr
{'updxlrtr invalid download rate'};
250 if ((!(-e
"${General::swroot}/proxy/enable")) && (!(-e
"${General::swroot}/proxy/enable_blue")))
252 $errormessage = $Lang::tr
{'updxlrtr web proxy service required'};
255 if (!($proxysettings{'ENABLE_UPDXLRATOR'} eq 'on'))
257 $errormessage = $Lang::tr
{'updxlrtr not enabled'};
263 system('/usr/local/bin/squidctrl restart >/dev/null 2>&1');
266 if ($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr remove file'})
268 $xlratorsettings{'EXTENDED_GUI'} = 'maintenance';
270 $updatefile = $xlratorsettings{'ID'};
272 unless ($updatefile =~ /^download\//)
274 ($vendorid,$uuid,$updatefile) = split('/',$updatefile);
275 if (-e
"$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
279 if (($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr cancel download'}) || ($xlratorsettings{'ACTION'} eq $Lang::tr
{'updxlrtr remove file'}))
281 $updatefile = $xlratorsettings{'ID'};
283 if ($updatefile =~ /^download\//)
285 ($uuid,$vendorid,$updatefile) = split('/',$updatefile);
287 if (-e
"$repository/download/$vendorid/$updatefile.info")
289 &General
::readhash
("$repository/download/$vendorid/$updatefile.info", \
%dlinfo);
291 $id = &getPID
("\\s${General::swroot}/updatexlrator/bin/download\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\\s\\d\\s\\d\$");
292 if ($id) { system("/bin/kill -9 $id"); }
293 $id = &getPID
("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\$");
294 if ($id) { system("/bin/kill -9 $id"); }
296 system("rm $repository/download/$vendorid/$updatefile.info");
299 if (-e
"$repository/download/$vendorid/$updatefile")
301 system("rm $repository/download/$vendorid/$updatefile");
307 $not_accessed_last = $xlratorsettings{'NOT_ACCESSED_LAST'};
308 undef($xlratorsettings{'NOT_ACCESSED_LAST'});
310 if (-e
"${General::swroot}/updatexlrator/settings")
312 &General
::readhash
("${General::swroot}/updatexlrator/settings", \
%xlratorsettings);
315 if ($xlratorsettings{'NOT_ACCESSED_LAST'} eq '')
317 $xlratorsettings{'NOT_ACCESSED_LAST'} = $not_accessed_last;
322 $checked{'ENABLE_LOG'}{'off'} = '';
323 $checked{'ENABLE_LOG'}{'on'} = '';
324 $checked{'ENABLE_LOG'}{$xlratorsettings{'ENABLE_LOG'}} = "checked='checked'";
325 $checked{'PASSIVE_MODE'}{'off'} = '';
326 $checked{'PASSIVE_MODE'}{'on'} = '';
327 $checked{'PASSIVE_MODE'}{$xlratorsettings{'PASSIVE_MODE'}} = "checked='checked'";
328 $checked{'LOW_DOWNLOAD_PRIORITY'}{'off'} = '';
329 $checked{'LOW_DOWNLOAD_PRIORITY'}{'on'} = '';
330 $checked{'LOW_DOWNLOAD_PRIORITY'}{$xlratorsettings{'LOW_DOWNLOAD_PRIORITY'}} = "checked='checked'";
331 $checked{'ENABLE_AUTOCHECK'}{'off'} = '';
332 $checked{'ENABLE_AUTOCHECK'}{'on'} = '';
333 $checked{'ENABLE_AUTOCHECK'}{$xlratorsettings{'ENABLE_AUTOCHECK'}} = "checked='checked'";
334 $checked{'FULL_AUTOSYNC'}{'off'} = '';
335 $checked{'FULL_AUTOSYNC'}{'on'} = '';
336 $checked{'FULL_AUTOSYNC'}{$xlratorsettings{'FULL_AUTOSYNC'}} = "checked='checked'";
337 $checked{'REMOVE_NOSOURCE'}{'off'} = '';
338 $checked{'REMOVE_NOSOURCE'}{'on'} = '';
339 $checked{'REMOVE_NOSOURCE'}{$xlratorsettings{'REMOVE_NOSOURCE'}} = "checked='checked'";
340 $checked{'REMOVE_OUTDATED'}{'off'} = '';
341 $checked{'REMOVE_OUTDATED'}{'on'} = '';
342 $checked{'REMOVE_OUTDATED'}{$xlratorsettings{'REMOVE_OUTDATED'}} = "checked='checked'";
343 $checked{'REMOVE_OBSOLETE'}{'off'} = '';
344 $checked{'REMOVE_OBSOLETE'}{'on'} = '';
345 $checked{'REMOVE_OBSOLETE'}{$xlratorsettings{'REMOVE_OBSOLETE'}} = "checked='checked'";
348 $selected{'AUTOCHECK_SCHEDULE'}{'daily'} = '';
349 $selected{'AUTOCHECK_SCHEDULE'}{'weekly'} = '';
350 $selected{'AUTOCHECK_SCHEDULE'}{'monthly'} = '';
351 $selected{'AUTOCHECK_SCHEDULE'}{$xlratorsettings{'AUTOCHECK_SCHEDULE'}} = "selected='selected'";
353 $selected{'NOT_ACCESSED_LAST'}{'week'} = '';
354 $selected{'NOT_ACCESSED_LAST'}{'month1'} = '';
355 $selected{'NOT_ACCESSED_LAST'}{'month3'} = '';
356 $selected{'NOT_ACCESSED_LAST'}{'month6'} = '';
357 $selected{'NOT_ACCESSED_LAST'}{'year'} = '';
358 $selected{'NOT_ACCESSED_LAST'}{$xlratorsettings{'NOT_ACCESSED_LAST'}} = "selected='selected'";
360 # ----------------------------------------------------
362 # ----------------------------------------------------
364 &Header
::showhttpheaders
();
366 &Header
::openpage
($Lang::tr
{'updxlrtr configuration'}, 1, '');
368 &Header
::openbigbox
('100%', 'left', '', $errormessage);
371 &Header
::openbox
('100%', 'left', $Lang::tr
{'error messages'});
372 print "<font class='base'>$errormessage </font>\n";
376 print "<form method='post' action='$ENV{'SCRIPT_NAME'}' enctype='multipart/form-data'>\n";
378 &Header
::openbox
('100%', 'left', "$Lang::tr{'updxlrtr update accelerator'}");
383 <td colspan='4'><b>$Lang::tr{'updxlrtr common settings'}</b></td>
386 <td class='base' width='25%'>$Lang::tr{'updxlrtr enable log'}:</td>
387 <td class='base' width='20%'><input type='checkbox' name='ENABLE_LOG' $checked{'ENABLE_LOG'}{'on'} /></td>
388 <td class='base' width='25%'></td>
389 <td class='base' width='30%'></td>
392 <td class='base'>$Lang::tr{'updxlrtr passive mode'}:</td>
393 <td class='base'><input type='checkbox' name='PASSIVE_MODE' $checked{'PASSIVE_MODE'}{'on'} /></td>
394 <td class='base'>$Lang::tr{'updxlrtr max disk usage'}:</td>
395 <td class='base'><input type='text' name='MAX_DISK_USAGE' value='$xlratorsettings{'MAX_DISK_USAGE'}' size='1' /> %</td>
401 <td colspan='4'><b>$Lang::tr{'updxlrtr performance options'}</b></td>
404 <td class='base' width='25%'>$Lang::tr{'updxlrtr low download priority'}:</td>
405 <td class='base' width='20%'><input type='checkbox' name='LOW_DOWNLOAD_PRIORITY' $checked{'LOW_DOWNLOAD_PRIORITY'}{'on'} /></td>
406 <td class='base' width='25%'>$Lang::tr{'updxlrtr max download rate'}: <img src='/blob.gif' alt='*' </td>
407 <td class='base' width='30%'><input type='text' name='MAX_DOWNLOAD_RATE' value='$xlratorsettings{'MAX_DOWNLOAD_RATE'}' size='5' /></td>
413 <td colspan='4'><b>$Lang::tr{'updxlrtr source checkup'}</b></td>
416 <td class='base' width='25%'>$Lang::tr{'updxlrtr enable autocheck'}:</td>
417 <td class='base' width='20%'><input type='checkbox' name='ENABLE_AUTOCHECK' $checked{'ENABLE_AUTOCHECK'}{'on'} /></td>
418 <td class='base' width='25%'>$Lang::tr{'updxlrtr source checkup schedule'}:</td>
419 <td class='base' width='30%'>
420 <select name='AUTOCHECK_SCHEDULE'>
421 <option value='daily' $selected{'AUTOCHECK_SCHEDULE'}{'daily'}>$Lang::tr{'updxlrtr daily'}</option>
422 <option value='weekly' $selected{'AUTOCHECK_SCHEDULE'}{'weekly'}>$Lang::tr{'updxlrtr weekly'}</option>
423 <option value='monthly' $selected{'AUTOCHECK_SCHEDULE'}{'monthly'}>$Lang::tr{'updxlrtr monthly'}</option>
428 <td class='base'>$Lang::tr{'updxlrtr full autosync'}:</td>
429 <td class='base'><input type='checkbox' name='FULL_AUTOSYNC' $checked{'FULL_AUTOSYNC'}{'on'} /></td>
437 <td align='center' width='20%'><input type='submit' name='ACTION' value='$Lang::tr{'save'}' /></td>
438 <td align='center' width='20%'><input type='submit' name='ACTION' value='$Lang::tr{'updxlrtr save and restart'}' /></td>
443 print" <td align='center' width='20%'><input type='submit' name='ACTION' value='$Lang::tr{'updxlrtr statistics'}";
444 if ($xlratorsettings{'EXTENDED_GUI'} eq 'statistics') { print " <<' "; } else { print " >>' "; }
447 print" <td align='center' width='20%'><input type='submit' name='ACTION' value='$Lang::tr{'updxlrtr maintenance'}";
448 if ($xlratorsettings{'EXTENDED_GUI'} eq 'maintenance') { print " <<' "; } else { print " >>' "; }
461 # ----------------------------------------------------
462 # List pending downloads - if any
463 # ----------------------------------------------------
465 if (($xlratorsettings{'EXTENDED_GUI'} ne 'statistics') && ($xlratorsettings{'EXTENDED_GUI'} ne 'maintenance'))
467 @downloadlist = <$repository/download/*>;
469 undef(@downloadfiles);
470 foreach (@downloadlist)
474 my @filelist = <$_/*>;
475 $vendorid = substr($_,rindex($_,"/")+1);
479 $updatefile = substr($_,rindex($_,"/")+1);
480 $updatefile .= ":download/$vendorid/$updatefile";
481 $updatefile = " ".$updatefile;
482 push(@downloadfiles, $updatefile);
489 &Header
::openbox
('100%', 'left', "$Lang::tr{'updxlrtr pending downloads'}");
493 <tr><td class='boldbase'><b>$Lang::tr{'updxlrtr current downloads'}</b></td></tr>
496 <colgroup span='3' width='2%'></colgroup>
497 <colgroup span='1' width='0*'></colgroup>
498 <colgroup span='3' width='5%'></colgroup>
499 <colgroup span='1' width='2%'></colgroup>
501 <td class='base' align='center'> </td>
502 <td class='base' align='left' colspan='2'><i>$Lang::tr{'updxlrtr source'}</i></td>
503 <td class='base' align='center'><i>$Lang::tr{'updxlrtr filename'}</i></td>
504 <td class='base' align='center'><i>$Lang::tr{'updxlrtr filesize'}</i></td>
505 <td class='base' align='center'><i>$Lang::tr{'date'}</i></td>
506 <td class='base' align='center'><i>$Lang::tr{'updxlrtr progress'}</i></td>
507 <td class='base' align='center'> </td>
512 foreach $updatefile (@downloadfiles)
514 $updatefile =~ s/.*://;
515 my $size_updatefile = 0;
517 if(-e
"$repository/$updatefile") {
518 $size_updatefile = (-s
"$repository/$updatefile");
519 $mtime = &getmtime
("$repository/$updatefile");
521 if (-e
"$repository/$updatefile.info") {
522 &General
::readhash
("$repository/$updatefile.info", \
%dlinfo);
529 print "<tr bgcolor='$Header::table1colour'>\n"; }
531 print "<tr bgcolor='$Header::table2colour'>\n"; }
533 $filesize = $size_updatefile;
534 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
536 my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($mtime);
537 $DAYdt = sprintf ("%.02d",$DAYdt);
538 $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
539 $YEARdt = sprintf ("%.04d",$YEARdt+1900);
540 $filedate = $YEARdt."-".$MONTHdt."-".$DAYdt;
542 ($uuid,$vendorid,$shortname) = split('/',$updatefile);
544 print "\t\t<td align='center' nowrap='nowrap'> ";
545 if (&getPID
("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\$"))
547 print "<img src='/images/updbooster/updxl-led-blue.gif' alt='$Lang::tr{'updxlrtr condition download'}' /> </td>\n";
549 print "<img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition suspended'}' /> </td>\n";
552 print "\t\t<td align='center' nowrap='nowrap'> ";
553 if ($vendorid =~ /^Adobe$/i)
555 print "<img src='/images/updbooster/updxl-src-adobe.gif' alt='Adobe'}' /> </td>\n";
556 } elsif ($vendorid =~ /^Microsoft$/i)
558 print "<img src='/images/updbooster/updxl-src-windows.gif' alt='Microsoft'}' /> </td>\n";
559 } elsif ($vendorid =~ /^Symantec$/i)
561 print "<img src='/images/updbooster/updxl-src-symantec.gif' alt='Symantec'}' /> </td>\n";
562 } elsif ($vendorid =~ /^Linux$/i)
564 print "<img src='/images/updbooster/updxl-src-linux.gif' alt='Linux'}' /> </td>\n";
565 } elsif ($vendorid =~ /^TrendMicro$/i)
567 print "<img src='/images/updbooster/updxl-src-trendmicro.gif' alt='Trend Micro'}' /> </td>\n";
568 } elsif ($vendorid =~ /^Apple$/i)
570 print "<img src='/images/updbooster/updxl-src-apple.gif' alt='Apple'}' /> </td>\n";
571 } elsif ($vendorid =~ /^Avast$/i)
573 print "<img src='/images/updbooster/updxl-src-avast.gif' alt='Avast'}' /> </td>\n";
576 if (-e
"/home/httpd/html/images/updbooster/updxl-src-" . $vendorid . ".gif")
578 print "<img src='/images/updbooster/updxl-src-" . $vendorid . ".gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
580 print "<img src='/images/updbooster/updxl-src-unknown.gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
584 $shortname = substr($updatefile,rindex($updatefile,"/")+1);
585 $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i;
587 $filesize = $dlinfo{'REMOTESIZE'};
588 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
589 $dlinfo{'VENDORID'}=ucfirst $vendorid;
592 <td class='base' align='center'> $dlinfo{'VENDORID'} </td>
593 <td class='base' align='left' title='cache:/$updatefile'>$shortname</td>
594 <td class='base' align='right' nowrap='nowrap'> $filesize </td>
595 <td class='base' align='center' nowrap='nowrap'> $filedate </td>
596 <td class='base' align='center' nowrap='nowrap'>
600 if ($dlinfo{'REMOTESIZE'} && $size_updatefile)
602 $percent=int(100 / ($dlinfo{'REMOTESIZE'} / $size_updatefile))."%";
604 print $percent; &percentbar
($percent);
608 <form method='post' name='frma$id' action='$ENV{'SCRIPT_NAME'}'>
609 <input type='image' name='$Lang::tr{'updxlrtr cancel download'}' src='/images/delete.gif' title='$Lang::tr{'updxlrtr cancel download'}' alt='$Lang::tr{'updxlrtr cancel download'}' />
610 <input type='hidden' name='ID' value='$updatefile' />
611 <input type='hidden' name='ACTION' value='$Lang::tr{'updxlrtr cancel download'}' />
619 print "</table>\n<br>\n<table>\n";
620 &printlegenddownload
();
626 # =====================================================================================
628 # =====================================================================================
630 if ($xlratorsettings{'EXTENDED_GUI'} eq 'statistics')
633 # ----------------------------------------------------
635 # ----------------------------------------------------
638 foreach (<$repository/*>)
642 unless ((/^$repository\/download
$/) || (/^$repository\
/lost\+found$/)) { push(@sources,$_); }
649 $vendorid=substr($_,rindex($_,'/')+1,length($_));
650 push(@vendors,$vendorid);
651 $vendorstats{$vendorid."_filesize"} = 0;
652 $vendorstats{$vendorid."_requests"} = 0;
653 $vendorstats{$vendorid."_files"} = 0;
654 $vendorstats{$vendorid."_cachehits"} = 0;
655 $vendorstats{$vendorid."_0"} = 0;
656 $vendorstats{$vendorid."_1"} = 0;
657 $vendorstats{$vendorid."_2"} = 0;
658 $vendorstats{$vendorid."_3"} = 0;
660 foreach $data (@updatelist)
662 if (-e
"$data/source.url")
664 open (FILE
,"$data/source.url");
668 $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl));
670 my $size_updatefile = 0;
671 if(-e
"$data/$updatefile") {
672 $size_updatefile = (-s
"$data/$updatefile");
677 #die "file not found: $data/$updatefile\n";
682 $filesize += $size_updatefile;
684 # File size for this source
686 $vendorstats{$vendorid."_filesize"} += $size_updatefile;
688 # Number of requests from cache for this source
690 open (FILE
,"$data/access.log");
696 $vendorstats{$vendorid."_requests"} += $counts;
697 $cachehits += $counts;
699 # Total number of files in cache
703 # Number of files for this source
705 $vendorstats{$vendorid."_files"}++;
707 # Count cache status occurences
709 open (FILE
,"$data/status");
713 $vendorstats{$vendorid."_".$_}++;
715 # Calculate cached traffic for this source
717 $vendorstats{$vendorid."_cachehits"} += $counts * $size_updatefile;
719 # Calculate total cached traffic
721 $cachedtraffic += $counts * $size_updatefile;
727 if ($numfiles) { $efficiency = sprintf("%.1f", $cachehits / $numfiles); }
729 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
730 1 while $cachedtraffic =~ s/^(-?\d+)(\d{3})/$1.$2/;
732 # ----------------------------------------------------
734 # ----------------------------------------------------
736 &Header
::openbox
('100%', 'left', "$Lang::tr{'updxlrtr cache statistics'}");
738 unless ($numfiles) { print "<i>$Lang::tr{'updxlrtr empty repository'}</i>\n<hr size='1'>\n"; }
742 <tr><td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td></tr>
744 <table cellpadding='3'>
746 <td align='left' class='base'><i>$Lang::tr{'updxlrtr cache dir'}</i></td>
747 <td align='center' class='base'><i>$Lang::tr{'size'}</i></td>
748 <td align='center' class='base'><i>$Lang::tr{'used'}</i></td>
749 <td align='center' class='base'><i>$Lang::tr{'free'}</i></td>
750 <td align='left' class='base' colspan='2'><i>$Lang::tr{'percentage'}</i></td>
755 open(DF
,"/bin/df -h $repository|");
760 $dfstr = join(' ',@dfdata);
761 my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr);
765 <td>[$repository]</td>
766 <td align='right'>$size</td>
767 <td align='right'>$used</td>
768 <td align='right'>$free</td>
772 &percentbar
($percent);
775 <td align='right'>$percent</td>
787 <td colspan='5'><b>$Lang::tr{'updxlrtr summary'}</b></td>
790 <td class='base' width='25%'>$Lang::tr{'updxlrtr total files'}:</td>
791 <td class='base' width='20%'><font color='$colourgray'>$numfiles</font></td>
792 <td class='base' width='25%'>$Lang::tr{'updxlrtr total cache size'}:</td>
793 <td class='base' width='15%' align='right'><font color='$colourgray'>$filesize</font></td>
794 <td class='base'></td>
797 <td class='base'>$Lang::tr{'updxlrtr efficiency index'}:</td>
798 <td class='base'><font color='$colourgray'>$efficiency</font></td>
799 <td class='base'>$Lang::tr{'updxlrtr total data from cache'}:</td>
800 <td class='base' align='right'><font color='$colourgray'>$cachedtraffic</font></td>
801 <td class='base'></td>
807 <td colspan='17'><b>$Lang::tr{'updxlrtr statistics by source'}</b></td>
810 <td class='base' colspan='2'><i>$Lang::tr{'updxlrtr source'}</i></td>
811 <td class='base' width='7%'> </td>
812 <td class='base' align='right'><i>$Lang::tr{'updxlrtr files'}</i></td>
813 <td class='base' width='7%'> </td>
814 <td class='base' align='right'><nobr><i>$Lang::tr{'updxlrtr cache size'}</i></nobr></td>
815 <td class='base' width='7%'> </td>
816 <td class='base' align='right'><nobr><i>$Lang::tr{'updxlrtr data from cache'}</i></nobr></td>
817 <td class='base' width='15%'> </td>
818 <td class='base'><img src="/images/updbooster/updxl-led-green.gif" /></td>
819 <td class='base' width='15%'> </td>
820 <td class='base'><img src="/images/updbooster/updxl-led-yellow.gif" /></td>
821 <td class='base' width='15%'> </td>
822 <td class='base'><img src="/images/updbooster/updxl-led-red.gif" /></td>
823 <td class='base' width='15%'> </td>
824 <td class='base'><img src="/images/updbooster/updxl-led-gray.gif" /></td>
825 <td class='base' width='90%'> </td>
836 unless ($vendorstats{$vendorid . "_files"}) { next; }
840 print "<tr bgcolor=''$color{'color20'}'>\n"; }
842 print "<tr bgcolor=''$color{'color22'}'>\n"; }
844 print "<td class='base' align='center'><nobr> ";
846 if ($vendorid =~ /^Adobe$/i)
848 print "<img src='/images/updbooster/updxl-src-adobe.gif' alt='Adobe'}' /> </nobr></td>\n";
849 print "<td class='base'> Adobe </td>\n";
850 } elsif ($vendorid =~ /^Microsoft$/i)
852 print "<img src='/images/updbooster/updxl-src-windows.gif' alt='Microsoft'}' /> </nobr></td>\n";
853 print "<td class='base'> Microsoft </td>\n";
854 } elsif ($vendorid =~ /^Symantec$/i)
856 print "<img src='/images/updbooster/updxl-src-symantec.gif' alt='Symantec'}' /> </nobr></td>\n";
857 print "<td class='base'> Symantec </td>\n";
858 } elsif ($vendorid =~ /^Linux$/i)
860 print "<img src='/images/updbooster/updxl-src-linux.gif' alt='Linux'}' /> </nobr></td>\n";
861 print "<td class='base'> Linux </td>\n";
862 } elsif ($vendorid =~ /^TrendMicro$/i)
864 print "<img src='/images/updbooster/updxl-src-trendmicro.gif' alt='Trend Micro'}' /> </nobr></td>\n";
865 print "<td class='base'> Trend Micro </td>\n";
866 } elsif ($vendorid =~ /^Apple$/i)
868 print "<img src='/images/updbooster/updxl-src-apple.gif' alt='Apple'}' /> </nobr></td>\n";
869 print "<td class='base'> Apple </td>\n";
870 } elsif ($vendorid =~ /^Avast$/i)
872 print "<img src='/images/updbooster/updxl-src-avast.gif' alt='Avast'}' /> </nobr></td>\n";
873 print "<td class='base'> Avast </td>\n";
874 } elsif ($vendorid =~ /^Avira$/i)
876 print "<img src='/images/updbooster/updxl-src-avira.gif' alt='Avira' /> </td>\n";
877 print "<td class='base'> Avira </td>\n";
878 } elsif ($vendorid =~ /^AVG$/i)
880 print "<img src='/images/updbooster/updxl-src-avg.gif' alt='AVG' /> </td>\n";
881 print "<td class='base'> AVG </td>\n";
882 } elsif ($vendorid =~ /^Ipfire$/i)
884 print "<img src='/images/IPFire.png' width='18' height='18' alt='IPFire' /> </td>\n";
885 print "<td class='base'> IPFire </td>\n";
888 if (-e
"/srv/web/ipfire/html/images/updbooster/updxl-src-" . $vendorid . ".gif")
890 print "<img src='/images/updbooster/updxl-src-" . $vendorid . ".gif' alt='" . ucfirst $vendorid . "' /> </nobr></td>\n";
892 print "<img src='/images/updbooster/updxl-src-unknown.gif' alt='" . ucfirst $vendorid . "' /> </nobr></td>\n";
894 print "<td class='base'> " . ucfirst $vendorid . " </td>\n";
897 print "<td class='base' colspan=2 align='right'>";
898 printf "%5d", $vendorstats{$vendorid."_files"};
899 print " </td>\n";
901 unless ($vendorstats{$vendorid."_filesize"}) { $vendorstats{$vendorid."_filesize"} = '0'; }
902 1 while $vendorstats{$vendorid."_filesize"} =~ s/^(-?\d+)(\d{3})/$1.$2/;
903 print "<td class='base' colspan=2 align='right'>";
904 printf "%15s", $vendorstats{$vendorid."_filesize"};
905 print " </td>\n";
907 unless ($vendorstats{$vendorid."_cachehits"}) { $vendorstats{$vendorid."_cachehits"} = '0'; }
908 1 while $vendorstats{$vendorid."_cachehits"} =~ s/^(-?\d+)(\d{3})/$1.$2/;
909 print "<td class='base' colspan=2 align='right'>";
910 printf "%15s", $vendorstats{$vendorid."_cachehits"};
911 print " </td>\n";
913 print "<td class='base' colspan=2 align='right'>";
914 printf "%5d", $vendorstats{$vendorid."_1"};
915 print " </td>\n";
917 print "<td class='base' colspan=2 align='right'>";
918 printf "%5d", $vendorstats{$vendorid."_3"};
919 print " </td>\n";
921 print "<td class='base' colspan=2 align='right'>";
922 printf "%5d", $vendorstats{$vendorid."_2"};
923 print " </td>\n";
925 print "<td class='base' colspan=2 align='right'>";
926 printf "%5d", $vendorstats{$vendorid."_0"};
927 print " </td>\n";
929 print "<td class='base'> </td>\n";
939 <td class='boldbase'> <b>$Lang::tr{'legend'}:</b></td>
940 <td class='base'> </td>
941 <td align='center'><img src='/images/updbooster/updxl-led-green.gif' alt='$Lang::tr{'updxlrtr condition ok'}' /></td>
942 <td class='base'>$Lang::tr{'updxlrtr condition ok'}</td>
943 <td class='base'> </td>
944 <td align='center'><img src='/images/updbooster/updxl-led-yellow.gif' alt='$Lang::tr{'updxlrtr condition nosource'}' /></td>
945 <td class='base'>$Lang::tr{'updxlrtr condition nosource'}</td>
946 <td class='base'> </td>
947 <td align='center'><img src='/images/updbooster/updxl-led-red.gif' alt='$Lang::tr{'updxlrtr condition outdated'}' /></td>
948 <td class='base'>$Lang::tr{'updxlrtr condition outdated'}</td>
949 <td class='base'> </td>
950 <td align='center'><img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition unknown'}' /></td>
951 <td class='base'>$Lang::tr{'updxlrtr condition unknown'}</td>
952 <td class='base'> </td>
964 # =====================================================================================
966 # =====================================================================================
968 if ($xlratorsettings{'EXTENDED_GUI'} eq 'maintenance')
972 # ----------------------------------------------------
974 # ----------------------------------------------------
976 &Header
::openbox
('100%', 'left', "$Lang::tr{'updxlrtr cache maintenance'}");
978 @sources= <$repository/download/*>;
980 undef @repositoryfiles;
985 @updatelist = <$_/*>;
986 $vendorid = substr($_,rindex($_,"/")+1);
990 $updatefile = substr($_,rindex($_,"/")+1);
991 $updatefile .= ":download/$vendorid/$updatefile";
992 $updatefile = " ".$updatefile;
993 push(@repositoryfiles,$updatefile);
999 foreach (<$repository/*>)
1003 unless (/^$repository\/download
$/) { push(@sources,$_); }
1010 $vendorid = substr($_,rindex($_,"/")+1);
1011 foreach(@updatelist)
1013 $uuid = substr($_,rindex($_,"/")+1);
1014 if (-e
"$_/source.url")
1016 open (FILE
,"$_/source.url");
1020 $updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl));
1021 $_ = $updatefile; tr/[A-Z]/[a-z]/;
1022 $updatefile = "$_:$vendorid/$uuid/$updatefile";
1023 push(@repositoryfiles,$updatefile);
1028 @repositoryfiles = sort(@repositoryfiles);
1030 unless (@repositoryfiles) { print "<i>$Lang::tr{'updxlrtr empty repository'}</i>\n<hr size='1'>\n"; }
1034 <tr><td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td></tr>
1036 <table cellpadding='3'>
1038 <td align='left' class='base'><i>$Lang::tr{'updxlrtr cache dir'}</i></td>
1039 <td align='center' class='base'><i>$Lang::tr{'size'}</i></td>
1040 <td align='center' class='base'><i>$Lang::tr{'used'}</i></td>
1041 <td align='center' class='base'><i>$Lang::tr{'free'}</i></td>
1042 <td align='left' class='base' colspan='2'><i>$Lang::tr{'percentage'}</i></td>
1047 open(DF
,"/bin/df -h $repository|");
1052 $dfstr = join(' ',@dfdata);
1053 my ($device,$size,$used,$free,$percent,$mount) = split(' ',$dfstr);
1057 <td>[$repository]</td>
1058 <td align='right'>$size</td>
1059 <td align='right'>$used</td>
1060 <td align='right'>$free</td>
1064 &percentbar
($percent);
1067 <td align='right'>$percent</td>
1073 if (@repositoryfiles)
1077 <form method='post' action='$ENV{'SCRIPT_NAME'}' enctype='multipart/form-data'>
1078 <table width='100%'>
1080 <td class='base' colspan='3'><input type='submit' name='ACTION' value='$Lang::tr{'updxlrtr purge'}' /> $Lang::tr{'updxlrtr all files'}</td>
1081 <td class='base' width='25%'>
1082 <input type='checkbox' name='REMOVE_OBSOLETE' $checked{'REMOVE_OBSOLETE'}{'on'} /> $Lang::tr{'updxlrtr not accessed'}
1084 <td class='base' colspan='3'>
1085 <select name='NOT_ACCESSED_LAST'>
1086 <option value='week' $selected{'NOT_ACCESSED_LAST'}{'week'}>$Lang::tr{'updxlrtr week'}</option>
1087 <option value='month1' $selected{'NOT_ACCESSED_LAST'}{'month1'}>$Lang::tr{'updxlrtr month'}</option>
1088 <option value='month3' $selected{'NOT_ACCESSED_LAST'}{'month3'}>$Lang::tr{'updxlrtr 3 months'}</option>
1089 <option value='month6' $selected{'NOT_ACCESSED_LAST'}{'month6'}>$Lang::tr{'updxlrtr 6 months'}</option>
1090 <option value='year' $selected{'NOT_ACCESSED_LAST'}{'year'}>$Lang::tr{'updxlrtr year'}</option>
1097 <td class='base' width='25%'>
1098 <input type='checkbox' name='REMOVE_NOSOURCE' $checked{'REMOVE_NOSOURCE'}{'on'} /> $Lang::tr{'updxlrtr marked as'}
1100 <td class='base' width='3%'><img src='/images/updbooster/updxl-led-yellow.gif' alt='$Lang::tr{'updxlrtr condition nosource'}' /></td>
1101 <td class='base' width='17%'>[<i>$Lang::tr{'updxlrtr condition nosource'}</i>]</td>
1102 <td class='base' width='25%'>
1103 <input type='checkbox' name='REMOVE_OUTDATED' $checked{'REMOVE_OUTDATED'}{'on'} /> $Lang::tr{'updxlrtr marked as'}
1105 <td class='base' width='3%'><img src='/images/updbooster/updxl-led-red.gif' alt='$Lang::tr{'updxlrtr condition outdated'}' /></td>
1106 <td class='base' width='27%'>[<i>$Lang::tr{'updxlrtr condition outdated'}</i>]</td>
1114 &printcurrentfiles
($Lang::tr
{'updxlrtr current files'}, @repositoryfiles);
1115 print "<br>\n<table>\n";
1116 &printlegendicons
();
1117 &printlegendspacer
();
1118 &printlegendstatus
();
1119 &printlegendspacer
();
1120 &printlegendsource
();
1124 &Header
::closebox
();
1128 # =====================================================================================
1130 &Header
::closebigbox
();
1132 &Header
::closepage
();
1134 # -------------------------------------------------------------------
1136 sub printcurrentfiles
1143 <tr><td class='boldbase'><b>$Lang::tr{'updxlrtr current files'}</b></td></tr>
1145 <table width='100%'>
1146 <colgroup span='2' width='2%'></colgroup>
1147 <colgroup span='1' width='0*'></colgroup>
1148 <colgroup span='4' width='5%'></colgroup>
1149 <colgroup span='1' width='2%'></colgroup>
1151 <td class='base' align='center'> </td>
1152 <td class='base' align='center'> </td>
1153 <td class='base' align='center'><i>$Lang::tr{'updxlrtr filename'}</i></td>
1154 <td class='base' align='center'><i>$Lang::tr{'updxlrtr filesize'}</i></td>
1155 <td class='base' align='center'><i>$Lang::tr{'date'}</i></td>
1156 <td class='base' align='center'><img src='/images/reload.gif' alt='$Lang::tr{'updxlrtr last access'}' /></td>
1157 <td class='base' align='center'><img src='/images/updbooster/updxl-globe.gif' alt='$Lang::tr{'updxlrtr last checkup'}' /></td>
1158 <td class='base' align='center'> </td>
1163 foreach $updatefile (@files)
1165 $updatefile =~ s/.*://;
1166 my $size_updatefile = 0;
1168 if(-e
"$repository/$updatefile") {
1169 $size_updatefile = (-s
"$repository/$updatefile");
1170 $mtime = &getmtime
("$repository/$updatefile");
1175 print "<tr bgcolor='$Header::table1colour'>\n"; }
1177 print "<tr bgcolor='$Header::table2colour'>\n"; }
1179 $filesize = $size_updatefile;
1180 1 while $filesize =~ s/^(-?\d+)(\d{3})/$1.$2/;
1182 my ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($mtime);
1183 $DAYdt = sprintf ("%.02d",$DAYdt);
1184 $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
1185 $YEARdt = sprintf ("%.04d",$YEARdt+1900);
1186 $filedate = $YEARdt."-".$MONTHdt."-".$DAYdt;
1188 $lastaccess = "n/a";
1191 $status = $sfUnknown;
1193 unless ($updatefile =~ /^download\//)
1195 ($vendorid,$uuid,$shortname) = split('/',$updatefile);
1197 if (-e
"$repository/$vendorid/$uuid/access.log")
1199 open (FILE
,"$repository/$vendorid/$uuid/access.log");
1204 ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]);
1205 $DAYdt = sprintf ("%.02d",$DAYdt);
1206 $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
1207 $YEARdt = sprintf ("%.04d",$YEARdt+1900);
1208 if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1)) { $lastaccess = $YEARdt."-".$MONTHdt."-".$DAYdt; }
1210 if (-e
"$repository/$vendorid/$uuid/checkup.log")
1212 open (FILE
,"$repository/$vendorid/$uuid/checkup.log");
1217 ($SECdt,$MINdt,$HOURdt,$DAYdt,$MONTHdt,$YEARdt) = localtime($metadata[-1]);
1218 $DAYdt = sprintf ("%.02d",$DAYdt);
1219 $MONTHdt = sprintf ("%.02d",$MONTHdt+1);
1220 $YEARdt = sprintf ("%.04d",$YEARdt+1900);
1221 if (($metadata[-1] =~ /^\d+/) && ($metadata[-1] >= 1)) { $lastcheck = $YEARdt."-".$MONTHdt."-".$DAYdt; }
1223 if (-e
"$repository/$vendorid/$uuid/status")
1225 open (FILE
,"$repository/$vendorid/$uuid/status");
1229 $status = $metadata[-1];
1232 ($uuid,$vendorid,$shortname) = split('/',$updatefile);
1233 $status = $sfOutdated;
1236 print "\t\t<td align='center' nowrap='nowrap'> ";
1237 if ($status == $sfUnknown)
1239 print "<img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition unknown'}' /> </td>\n";
1241 if ($status == $sfOk)
1243 print "<img src='/images/updbooster/updxl-led-green.gif' alt='$Lang::tr{'updxlrtr condition ok'}' /> </td>\n";
1245 if ($status == $sfNoSource)
1247 print "<img src='/images/updbooster/updxl-led-yellow.gif' alt='$Lang::tr{'updxlrtr condition nosource'}' /> </td>\n";
1249 if (($status == $sfOutdated) && (!($updatefile =~ /^download\//i
)))
1251 print "<img src='/images/updbooster/updxl-led-red.gif' alt='$Lang::tr{'updxlrtr condition outdated'}' /> </td>\n";
1253 if (($status == $sfOutdated) && ($updatefile =~ /^download\//i
))
1255 print "<img src='/images/updbooster/updxl-led-blue.gif' alt='$Lang::tr{'updxlrtr condition download'}' /> </td>\n";
1258 print "\t\t<td align='center' nowrap='nowrap'> ";
1259 if ($vendorid =~ /^Adobe$/i)
1261 print "<img src='/images/updbooster/updxl-src-adobe.gif' alt='Adobe'}' /> </td>\n";
1262 } elsif ($vendorid =~ /^Microsoft$/i)
1264 print "<img src='/images/updbooster/updxl-src-windows.gif' alt='Microsoft'}' /> </td>\n";
1265 } elsif ($vendorid =~ /^Symantec$/i)
1267 print "<img src='/images/updbooster/updxl-src-symantec.gif' alt='Symantec'}' /> </td>\n";
1268 } elsif ($vendorid =~ /^Linux$/i)
1270 print "<img src='/images/updbooster/updxl-src-linux.gif' alt='Linux'}' /> </td>\n";
1271 } elsif ($vendorid =~ /^TrendMicro$/i)
1273 print "<img src='/images/updbooster/updxl-src-trendmicro.gif' alt='Trend Micro'}' /> </td>\n";
1274 } elsif ($vendorid =~ /^Apple$/i)
1276 print "<img src='/images/updbooster/updxl-src-apple.gif' alt='Apple'}' /> </td>\n";
1277 } elsif ($vendorid =~ /^Avast$/i)
1279 print "<img src='/images/updbooster/updxl-src-avast.gif' alt='Avast'}' /> </td>\n";
1280 } elsif ($vendorid =~ /^Avira$/i)
1282 print "<img src='/images/updbooster/updxl-src-avira.gif' alt='Avira' /> </td>\n";
1283 } elsif ($vendorid =~ /^AVG$/i)
1285 print "<img src='/images/updbooster/updxl-src-avg.gif' alt='AVG' /> </td>\n";
1286 } elsif ($vendorid =~ /^Ipfire$/i)
1288 print "<img src='/images/IPFire.png' width='18' height='18' alt='IPFire' /> </td>\n";
1292 if (-e
"/srv/web/ipfire/html/images/updbooster/updxl-src-" . $vendorid . ".gif")
1294 print "<img src='/images/updbooster/updxl-src-" . $vendorid . ".gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
1296 print "<img src='/images/updbooster/updxl-src-unknown.gif' alt='" . ucfirst $vendorid . "' /> </td>\n";
1300 $shortname = substr($updatefile,rindex($updatefile,"/")+1);
1301 $shortname =~ s/(.*)_[\da-f]*(\.(exe|cab|psf)$)/$1_*$2/i;
1304 <td class='base' align='left' title='cache:/$updatefile'><a href="/updatecache/$updatefile">$shortname</a></td>
1305 <td class='base' align='right' nowrap='nowrap'> $filesize </td>
1306 <td class='base' align='center' nowrap='nowrap'> $filedate </td>
1307 <td class='base' align='center' nowrap='nowrap'> $lastaccess </td>
1308 <td class='base' align='center' nowrap='nowrap'> $lastcheck </td>
1310 <form method='post' name='frma$id' action='$ENV{'SCRIPT_NAME'}'>
1311 <input type='image' name='$Lang::tr{'updxlrtr remove file'}' src='/images/delete.gif' title='$Lang::tr{'updxlrtr remove file'}' alt='$Lang::tr{'updxlrtr remove file'}' />
1312 <input type='hidden' name='ID' value='$updatefile' />
1313 <input type='hidden' name='ACTION' value='$Lang::tr{'updxlrtr remove file'}' />
1325 # -------------------------------------------------------------------
1327 sub printlegenddownload
1331 <td class='boldbase'> <b>$Lang::tr{'legend'}:</b></td>
1332 <td class='base'> </td>
1333 <td><img src='/images/updbooster/updxl-led-blue.gif' alt='$Lang::tr{'updxlrtr condition download'}' /></td>
1334 <td class='base'>$Lang::tr{'updxlrtr condition download'}</td>
1335 <td class='base'> </td>
1336 <td class='base'> </td>
1337 <td><img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition suspended'}' /></td>
1338 <td class='base'>$Lang::tr{'updxlrtr condition suspended'}</td>
1339 <td class='base'> </td>
1340 <td class='base'> </td>
1341 <td><img src='/images/delete.gif' alt='$Lang::tr{'updxlrtr cancel download'}' /></td>
1342 <td class='base'>$Lang::tr{'updxlrtr cancel download'}</td>
1348 # -------------------------------------------------------------------
1350 sub printlegendicons
1357 <td class='boldbase'> <b>$Lang::tr{'legend'}:</b></td>
1358 <td class='base'> </td>
1359 <td><img src='/images/reload.gif' alt='$Lang::tr{'updxlrtr last access'}' /></td>
1360 <td class='base'>$Lang::tr{'updxlrtr last access'}</td>
1361 <td class='base'> </td>
1362 <td><img src='/images/updbooster/updxl-globe.gif' alt='$Lang::tr{'updxlrtr last checkup'}' /></td>
1363 <td class='base'>$Lang::tr{'updxlrtr last checkup'}</td>
1364 <td class='base'> </td>
1365 <td><img src='/images/updbooster/delete.gif' alt='$Lang::tr{'updxlrtr remove file'}' /></td>
1366 <td class='base'>$Lang::tr{'updxlrtr remove file'}</td>
1367 <td class='base'> </td>
1368 <td class='base'> </td>
1369 <td class='base'> </td>
1375 # -------------------------------------------------------------------
1377 sub printlegendstatus
1381 <td class='base'> $Lang::tr{'status'}:</td>
1382 <td class='base'> </td>
1383 <td align='center'><img src='/images/updbooster/updxl-led-green.gif' alt='$Lang::tr{'updxlrtr condition ok'}' /></td>
1384 <td class='base'>$Lang::tr{'updxlrtr condition ok'}</td>
1385 <td class='base'> </td>
1386 <td align='center'><img src='/images/updbooster/updxl-led-yellow.gif' alt='$Lang::tr{'updxlrtr condition nosource'}' /></td>
1387 <td class='base'>$Lang::tr{'updxlrtr condition nosource'}</td>
1388 <td class='base'> </td>
1389 <td align='center'><img src='/images/updbooster/updxl-led-red.gif' alt='$Lang::tr{'updxlrtr condition outdated'}' /></td>
1390 <td class='base'>$Lang::tr{'updxlrtr condition outdated'}</td>
1391 <td class='base'> </td>
1392 <td class='base'> </td>
1394 <td class='base'> </td>
1397 <td class='base'> </td>
1398 <td class='base'> </td>
1399 <td align='center'><img src='/images/updbooster/updxl-led-blue.gif' alt='$Lang::tr{'updxlrtr condition download'}' /></td>
1400 <td class='base'>$Lang::tr{'updxlrtr condition download'}</td>
1401 <td class='base'> </td>
1402 <td align='center'><img src='/images/updbooster/updxl-led-gray.gif' alt='$Lang::tr{'updxlrtr condition unknown'}' /></td>
1403 <td class='base'>$Lang::tr{'updxlrtr condition unknown'}</td>
1404 <td class='base'> </td>
1405 <td class='base'> </td>
1406 <td class='base'> </td>
1407 <td class='base'> </td>
1408 <td class='base'> </td>
1410 <td class='base'> </td>
1416 # -------------------------------------------------------------------
1418 sub printlegendsource
1425 <td class='base'> $Lang::tr{'updxlrtr source'}:</td>
1426 <td class='base'> </td>
1427 <td align='center'><img src='/images/updbooster/updxl-src-adobe.gif' alt='Adobe' /></td>
1428 <td class='base'>Adobe</td>
1429 <td class='base'> </td>
1430 <td align='center'><img src='/images/updbooster/updxl-src-apple.gif' alt='Apple' /></td>
1431 <td class='base'>Apple</td>
1432 <td class='base'> </td>
1433 <td align='center'><img src='/images/updbooster/updxl-src-avast.gif' alt='Avast' /></td>
1434 <td class='base'>Avast</td>
1435 <td class='base'> </td>
1436 <td align='center'><img src='/images/updbooster/updxl-src-linux.gif' alt='Linux' /></td>
1437 <td class='base'>Linux</td>
1440 <td colspan='13'></td>
1443 <td class='base'> </td>
1444 <td class='base'> </td>
1445 <td align='center'><img src='/images/updbooster/updxl-src-windows.gif' alt='Microsoft' /></td>
1446 <td class='base'>Microsoft</td>
1447 <td class='base'> </td>
1448 <td align='center'><img src='/images/updbooster/updxl-src-symantec.gif' alt='Symantec' /></td>
1449 <td class='base'>Symantec</td>
1450 <td class='base'> </td>
1451 <td align='center'><img src='/images/updbooster/updxl-src-trendmicro.gif' alt='Trend Micro' /></td>
1452 <td class='base'>Trend Micro</td>
1453 <td class='base'> </td>
1454 <td align='center'><img src='/images/IPFire.png' width='18' height='18' alt='IPFire' /></td>
1455 <td class='base'>IPFire</td>
1458 <td class='base'> </td>
1459 <td class='base'> </td>
1460 <td align='center'><img src='/images/updbooster/updxl-src-avira.gif' alt='Avira' /></td>
1461 <td class='base'>Avira</td>
1462 <td class='base'> </td>
1463 <td align='center'><img src='/images/updbooster/updxl-src-avg.gif' alt='AVG' /></td>
1464 <td class='base'>AVG</td>
1465 <td class='base'> </td>
1466 <td align='center'><img src='/images/updbooster/updxl-src-unknown.gif' alt='$Lang::tr{'updxlrtr other'}' /></td>
1467 <td class='base'>$Lang::tr{'updxlrtr other'}</td>
1468 <td class='base'> </td>
1469 <td align='center'></td>
1470 <td class='base'> </td>
1478 # -------------------------------------------------------------------
1480 sub printlegendspacer
1484 <td colspan='13'> <br></td>
1490 # -------------------------------------------------------------------
1495 if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'daily'))
1497 system('/usr/local/bin/updxlratorctrl cron daily >/dev/null 2>&1');
1499 if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'weekly'))
1501 system('/usr/local/bin/updxlratorctrl cron weekly >/dev/null 2>&1');
1503 if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'monthly'))
1505 system('/usr/local/bin/updxlratorctrl cron monthly >/dev/null 2>&1');
1508 # don't save those variable to the settings file,
1509 # but we wan't to have them in the hash again after saving to file
1510 my $obsolete = $xlratorsettings{'REMOVE_OBSOLETE'};
1511 my $nosource = $xlratorsettings{'REMOVE_NOSOURCE'};
1512 my $outdated = $xlratorsettings{'REMOVE_OUTDATED'};
1513 my $gui = $xlratorsettings{'EXTENDED_GUI'};
1515 delete($xlratorsettings{'REMOVE_OBSOLETE'});
1516 delete($xlratorsettings{'REMOVE_NOSOURCE'});
1517 delete($xlratorsettings{'REMOVE_OUTDATED'});
1519 delete($xlratorsettings{'EXTENDED_GUI'});
1521 &General
::writehash
("${General::swroot}/updatexlrator/settings", \
%xlratorsettings);
1523 # put temp variables back into the hash
1524 $xlratorsettings{'REMOVE_OBSOLETE'} = $obsolete;
1525 $xlratorsettings{'REMOVE_NOSOURCE'} = $nosource;
1526 $xlratorsettings{'REMOVE_OUTDATED'} = $outdated;
1527 $xlratorsettings{'EXTENDED_GUI'} = $gui;
1530 # -------------------------------------------------------------------
1534 my $percent = $_[0];
1538 if ($percent =~ m/^(\d+)%$/ )
1541 <table width='100' border='1' cellspacing='0' cellpadding='0' style='border-width:1px;border-style:solid;border-color:$fg;width:100px;height:10px;'>
1545 if ($percent eq "100%") {
1546 print "<td width='100%' bgcolor='$fg' style='background-color:$fg;border-style:solid;border-width:1px;border-color:$bg'>"
1547 } elsif ($percent eq "0%") {
1548 print "<td width='100%' bgcolor='$bg' style='background-color:$bg;border-style:solid;border-width:1px;border-color:$bg'>"
1550 print "<td width='$percent' bgcolor='$fg' style='background-color:$fg;border-style:solid;border-width:1px;border-color:$bg'></td><td width='" . (100-$1) . "%' bgcolor='$bg' style='background-color:$bg;border-style:solid;border-width:1px;border-color:$bg'>"
1553 <img src='/images/null.gif' width='1' height='1' alt='' /></td></tr></table>
1559 # -------------------------------------------------------------------
1563 my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($_[0]);
1568 # -------------------------------------------------------------------
1573 my @psdata=`ps ax --no-heading`;
1577 if (/$_[0]/) { ($pid)=/^\s*(\d+)/; }
1583 # -------------------------------------------------------------------