require '/var/ipfire/general-functions.pl';
require "${General::swroot}/lang.pl";
require "${General::swroot}/header.pl";
+require '/opt/pakfire/lib/functions.pl';
my $configfile = "/var/ipfire/main/send_profile";
if ("$fireinfosettings{'ACTION'}" eq "trigger") {
if ($fireinfosettings{'ENABLE_FIREINFO'} eq 'off') {
&General::log($Lang::tr{'fireinfo is enabled'});
- system ('/usr/bin/touch', $configfile);
+
+ # Write empty configfile.
+ open(FILE, ">$configfile");
+ close(FILE);
+
$fireinfosettings{'ENABLE_FIREINFO'} = 'on';
} else {
&General::log($Lang::tr{'fireinfo is disabled'});
unlink "$configfile";
$fireinfosettings{'ENABLE_FIREINFO'} = 'off';
}
- system("/usr/local/bin/fireinfoctrl &");
+ &General::system_background("/usr/local/bin/fireinfoctrl");
}
&Header::openpage('Fireinfo', 1, '');
&Header::closebox();
}
-my $ipfire_version = `cat /etc/system-release`;
-my $pakfire_version = `cat /opt/pakfire/etc/pakfire.conf | grep "version =" | cut -d\\" -f2`;
-my $kernel_version = `uname -a`;
+# Get IPFire version string.
+open(FILE, "/etc/system-release");
+my $ipfire_version = <FILE>;
+close(FILE);
+
+my $pakfire_version = &Pakfire::make_version();
+my $kernel_version = &General::system_output("uname", "-a");
&Header::openbox('100%', 'left', $Lang::tr{'fireinfo system version'});
print <<END;
- <table width="100%">
+ <table cellspacing='1' cellpadding='0' class='tbl'>
<tr>
- <td>$Lang::tr{'fireinfo ipfire version'}:</td>
- <td>$ipfire_version</td>
+ <td align='center' bgcolor='#F0F0F0' width='15%'>$Lang::tr{'fireinfo ipfire version'}</td>
+ <td bgcolor='#F0F0F0'><code>$ipfire_version</code></td>
</tr>
<tr>
- <td>$Lang::tr{'fireinfo pakfire version'}:</td>
- <td>$pakfire_version</td>
+ <td align='center' bgcolor='#D6D6D6' width='15%'>$Lang::tr{'fireinfo pakfire version'}</td>
+ <td bgcolor='#D6D6D6'><code>$pakfire_version</code></td>
</tr>
<tr>
- <td>$Lang::tr{'fireinfo kernel version'}:</td>
- <td>$kernel_version</td>
+ <td align='center' bgcolor='#F0F0F0' width='15%'>$Lang::tr{'fireinfo kernel version'}</td>
+ <td bgcolor='#F0F0F0'><code>$kernel_version</code></td>
</tr>
</table>
END
&Header::closebox();
# Read pregenerated profile data
-my $profile = `cat /var/ipfire/fireinfo/profile`;
+open(FILE, "/var/ipfire/fireinfo/profile");
+my @profile = <FILE>;
+close(FILE);
print "<form method='post' action='$ENV{'SCRIPT_NAME'}'>\n";
# Read profile ID from file
-my $profile_id = `cat /var/ipfire/fireinfo/public_id`;
+open(FILE, "/var/ipfire/fireinfo/public_id");
+my $profile_id = <FILE>;
+close(FILE);
chomp($profile_id);
&Header::openbox('100%', 'left', $Lang::tr{'fireinfo settings'});
</tr>
<tr>
<td colspan='2'>
- <textarea rows="25" cols="75" readonly="readonly">$profile</textarea>
+ <textarea rows="25" cols="75" readonly="readonly">@profile</textarea>
</td>
</tr>
</table>