diff options
Diffstat (limited to 'SiteSummary.pm')
-rw-r--r-- | SiteSummary.pm | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/SiteSummary.pm b/SiteSummary.pm index 9093f53..1f33468 100644 --- a/SiteSummary.pm +++ b/SiteSummary.pm @@ -20,7 +20,7 @@ our @EXPORT = qw( my $pwd = "/var/lib/sitesummary/entries"; # Path to the entries # File for debian-edu configuration -my $debian_edu_config = "/etc/debian-edu/config"; +my $debian_edu_config = "/debian-edu/config"; sub get_filepath_current { my ($hostid, $file) = @_; @@ -87,17 +87,17 @@ sub get_linux_kernel_ver { } sub get_debian_edu_profile { -# my $hostid = shift; - if ( ! -e $debian_edu_config ) { -# print STDERR "error: Missing $debian_edu_config file.\n"; + my $hostid = shift; + my $path = get_filepath_current($hostid, $debian_edu_config); + if ( ! -e $path ) { return undef; } - if (open (FILE, $debian_edu_config)) { + if (open (FILE, $path)) { while (<FILE>) { chomp; s/\#.+$//; next if not (/PROFILE/); - s/^"PROFILE=//; + s/^PROFILE=//; return $_; } } @@ -105,11 +105,12 @@ sub get_debian_edu_profile { } sub get_debian_edu_ver { - if ( ! -e $debian_edu_config ) { -# print STDERR "error: Missing $debian_edu_config file.\n"; + my $hostid = shift; + my $path = get_filepath_current($hostid, $debian_edu_config); + if ( ! -e $path ) { return undef; } - if (open (FILE, $debian_edu_config)) { + if (open (FILE, $path)) { while (<FILE>) { chomp; s/\#.+$//; |