mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
fireinfo.cgi: Use new system methods
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
a81cbf6127
commit
2ccb63bce8
@@ -49,7 +49,11 @@ if ( -e "$configfile" ) {
|
||||
if ("$fireinfosettings{'ACTION'}" eq "trigger") {
|
||||
if ($fireinfosettings{'ENABLE_FIREINFO'} eq 'off') {
|
||||
&General::log($Lang::tr{'fireinfo is enabled'});
|
||||
&General::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'});
|
||||
@@ -84,9 +88,13 @@ if ($errormessage) {
|
||||
&Header::closebox();
|
||||
}
|
||||
|
||||
my $ipfire_version = `cat /etc/system-release`;
|
||||
# Get IPFire version string.
|
||||
open(FILE, "/etc/system-release");
|
||||
my $ipfire_version = <FILE>;
|
||||
close(FILE);
|
||||
|
||||
my $pakfire_version = &Pakfire::make_version();
|
||||
my $kernel_version = `uname -a`;
|
||||
my $kernel_version = &General::system_output("uname", "-a");
|
||||
|
||||
&Header::openbox('100%', 'left', $Lang::tr{'fireinfo system version'});
|
||||
print <<END;
|
||||
@@ -108,12 +116,17 @@ 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);
|
||||
chomp($profile);
|
||||
|
||||
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'});
|
||||
|
||||
Reference in New Issue
Block a user