aboutsummaryrefslogtreecommitdiffstats
path: root/SiteSummary.pm
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2006-10-04 08:32:35 +0000
committerPetter Reinholdtsen <pere@hungry.com>2006-10-04 08:32:35 +0000
commitc0263cb7af9810de7e0cf26b4326a70311861bff (patch)
tree91067b704a384f88d53e19aeb67f4565afb7e98c /SiteSummary.pm
parentaf5ecd8d9cb7231756fba13418766e45816a0b9c (diff)
downloadsitesummary-c0263cb7af9810de7e0cf26b4326a70311861bff.tar.gz
sitesummary-c0263cb7af9810de7e0cf26b4326a70311861bff.tar.bz2
sitesummary-c0263cb7af9810de7e0cf26b4326a70311861bff.tar.xz
* Add collector for debian-edu configuration. Correct server
summary part to use the collected file.
Diffstat (limited to 'SiteSummary.pm')
-rw-r--r--SiteSummary.pm19
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/\#.+$//;