my %vendorstats=();
my $repository = "/var/updatecache/";
-my $webhome = "/srv/web/ipfire/html";
+my $webhome = "/srv/web/ipfire/html";
my $hintcolour = '#FFFFCC';
my $colourgray = '#808080';
&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
&General::readhash("${General::swroot}/main/settings", \%mainsettings);
&General::readhash("${General::swroot}/proxy/settings", \%proxysettings);
-&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
$xlratorsettings{'ACTION'} = '';
$xlratorsettings{'ENABLE_LOG'} = 'off';
if (($xlratorsettings{'REMOVE_NOSOURCE'} eq 'on') && ($status == $sfNoSource))
{
- if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+ if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
}
if (($xlratorsettings{'REMOVE_OUTDATED'} eq 'on') && ($status == $sfOutdated))
{
- if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+ if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
}
if ($xlratorsettings{'REMOVE_OBSOLETE'} eq 'on')
{
if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'week') && ($lastaccess < (time - 604800)))
{
- if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+ if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
}
if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month1') && ($lastaccess < (time - 2505600)))
{
- if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+ if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
}
if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month3') && ($lastaccess < (time - 7516800)))
{
- if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+ if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
}
if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'month6') && ($lastaccess < (time - 15033600)))
{
- if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+ if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
}
if (($xlratorsettings{'NOT_ACCESSED_LAST'} eq 'year') && ($lastaccess < (time - 31536000)))
{
- if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+ if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
}
}
}
&savesettings;
- system('/usr/local/bin/squidctrl restart >/dev/null 2>&1');
+ &General::system('/usr/local/bin/squidctrl', 'restart');
}
if ($xlratorsettings{'ACTION'} eq $Lang::tr{'updxlrtr remove file'})
unless ($updatefile =~ /^download\//)
{
($vendorid,$uuid,$updatefile) = split('/',$updatefile);
- if (-e "$repository/$vendorid/$uuid/$updatefile") { system("rm -r $repository/$vendorid/$uuid"); }
+ if (-e "$repository/$vendorid/$uuid/$updatefile") { &General::system("rm", "-r", "$repository/$vendorid/$uuid"); }
}
}
&General::readhash("$repository/download/$vendorid/$updatefile.info", \%dlinfo);
$id = &getPID("\\s${General::swroot}/updatexlrator/bin/download\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\\s\\d\\s\\d\$");
- if ($id) { system("/bin/kill -9 $id"); }
+ if ($id) { &General::system("/bin/kill", "-9", "$id"); }
$id = &getPID("\\s/usr/bin/wget\\s.*\\s".quotemeta($dlinfo{'SRCURL'})."\$");
- if ($id) { system("/bin/kill -9 $id"); }
+ if ($id) { &General::system("/bin/kill", "-9", "$id"); }
- system("rm $repository/download/$vendorid/$updatefile.info");
+ &General::system("rm", "$repository/download/$vendorid/$updatefile.info");
}
if (-e "$repository/download/$vendorid/$updatefile")
{
- system("rm $repository/download/$vendorid/$updatefile");
+ &General::system("rm", "$repository/download/$vendorid/$updatefile");
}
}
<tr>
<td class='base'>$Lang::tr{'updxlrtr passive mode'}:</td>
<td class='base'><input type='checkbox' name='PASSIVE_MODE' $checked{'PASSIVE_MODE'}{'on'} /></td>
- <td class='base'>$Lang::tr{'updxlrtr max disk usage'}:</td>
- <td class='base'><input type='text' name='MAX_DISK_USAGE' value='$xlratorsettings{'MAX_DISK_USAGE'}' size='1' /> %</td>
+ <td class='base'>$Lang::tr{'updxlrtr max disk usage'}: <img src='/blob.gif' alt='*' /></td>
+ <td class='base'><input type='text' name='MAX_DISK_USAGE' value='$xlratorsettings{'MAX_DISK_USAGE'}' size='3' /> %</td>
</tr>
</table>
<hr size='1'>
<tr>
<td class='base' width='25%'>$Lang::tr{'updxlrtr low download priority'}:</td>
<td class='base' width='20%'><input type='checkbox' name='LOW_DOWNLOAD_PRIORITY' $checked{'LOW_DOWNLOAD_PRIORITY'}{'on'} /></td>
- <td class='base' width='25%'>$Lang::tr{'updxlrtr max download rate'}: <img src='/blob.gif' alt='*' </td>
+ <td class='base' width='25%'>$Lang::tr{'updxlrtr max download rate'}:</td>
<td class='base' width='30%'><input type='text' name='MAX_DOWNLOAD_RATE' value='$xlratorsettings{'MAX_DOWNLOAD_RATE'}' size='5' /></td>
</tr>
</table>
$id = 0;
foreach $updatefile (@downloadfiles)
{
- $updatefile =~ s/.*://;
+ $updatefile =~ s/.*:download/download/;
my $size_updatefile = 0;
my $mtime = 0;
if(-e "$repository/$updatefile") {
print <<END
<table>
-<tr><td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td></tr>
+<tr>
+<td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td>
+</tr>
</table>
-<table cellpadding='3'>
+<table width='75%' cellspacing='5'>
<tr>
-<td align='left' class='base'><i>$Lang::tr{'updxlrtr cache dir'}</i></td>
-<td align='center' class='base'><i>$Lang::tr{'size'}</i></td>
-<td align='center' class='base'><i>$Lang::tr{'used'}</i></td>
-<td align='center' class='base'><i>$Lang::tr{'free'}</i></td>
-<td align='left' class='base' colspan='2'><i>$Lang::tr{'percentage'}</i></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'updxlrtr cache dir'}</b></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'size'}</b></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'used'}</b></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'free'}</b></td>
+<td></td>
+<td align='left' class='boldbase' colspan='2'><b>$Lang::tr{'percentage'}</b></td>
</tr>
END
;
print <<END
<tr>
-<td>[$repository]</td>
-<td align='right'>$size</td>
-<td align='right'>$used</td>
-<td align='right'>$free</td>
-<td>
+<td align='center'>[$repository]</td>
+<td align='center'>$size</td>
+<td align='center'>$used</td>
+<td align='center'>$free</td>
+<td align='right' colspan='2'>
END
;
&percentbar($percent);
print <<END
</td>
-<td align='right'>$percent</td>
+<td align='center'>$percent</td>
</tr>
</table>
END
{
next if(/\.info$/);
$updatefile = substr($_,rindex($_,"/")+1);
- $updatefile .= ":download/$vendorid/$updatefile";
+ $_ = $updatefile; tr/[A-Z]/[a-z]/;
+ $updatefile = "$_:separator:download/$vendorid/$updatefile";
$updatefile = " ".$updatefile;
push(@repositoryfiles,$updatefile);
}
chomp($sourceurl);
$updatefile = substr($sourceurl,rindex($sourceurl,'/')+1,length($sourceurl));
$_ = $updatefile; tr/[A-Z]/[a-z]/;
- $updatefile = "$_:$vendorid/$uuid/$updatefile";
+ $updatefile = "$_:separator:$vendorid/$uuid/$updatefile";
push(@repositoryfiles,$updatefile);
}
}
print <<END
<table>
-<tr><td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td></tr>
+<tr>
+<td class='boldbase'><b>$Lang::tr{'updxlrtr disk usage'}</b></td>
+</tr>
</table>
-<table cellpadding='3'>
+<table width='75%' cellspacing='5'>
<tr>
-<td align='left' class='base'><i>$Lang::tr{'updxlrtr cache dir'}</i></td>
-<td align='center' class='base'><i>$Lang::tr{'size'}</i></td>
-<td align='center' class='base'><i>$Lang::tr{'used'}</i></td>
-<td align='center' class='base'><i>$Lang::tr{'free'}</i></td>
-<td align='left' class='base' colspan='2'><i>$Lang::tr{'percentage'}</i></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'updxlrtr cache dir'}</b></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'size'}</b></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'used'}</b></td>
+<td align='center' class='boldbase'><b>$Lang::tr{'free'}</b></td>
+<td></td>
+<td align='left' class='boldbase' colspan='2'><b>$Lang::tr{'percentage'}</b></td>
</tr>
END
;
print <<END
<tr>
-<td>[$repository]</td>
-<td align='right'>$size</td>
-<td align='right'>$used</td>
-<td align='right'>$free</td>
-<td>
+<td align='center'>[$repository]</td>
+<td align='center'>$size</td>
+<td align='center'>$used</td>
+<td align='center'>$free</td>
+<td align='right' colspan='2'>
END
;
&percentbar($percent);
print <<END
</td>
-<td align='right'>$percent</td>
+<td align='center'>$percent</td>
</tr>
</table>
END
$id = 0;
foreach $updatefile (@files)
{
- $updatefile =~ s/.*://;
+ $updatefile =~ s/.*:separator://;
my $size_updatefile = 0;
my $mtime = 0;
if(-e "$repository/$updatefile") {
if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'daily'))
{
- system('/usr/local/bin/updxlratorctrl cron daily >/dev/null 2>&1');
+ &General::system('/usr/local/bin/updxlratorctrl', 'cron', 'daily');
}
if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'weekly'))
{
- system('/usr/local/bin/updxlratorctrl cron weekly >/dev/null 2>&1');
+ &General::system('/usr/local/bin/updxlratorctrl', 'cron', 'weekly');
}
if (($xlratorsettings{'ENABLE_AUTOCHECK'} eq 'on') && ($xlratorsettings{'AUTOCHECK_SCHEDULE'} eq 'monthly'))
{
- system('/usr/local/bin/updxlratorctrl cron monthly >/dev/null 2>&1');
+ &General::system('/usr/local/bin/updxlratorctrl', 'cron', 'monthly');
}
# don't save those variable to the settings file,