aboutsummaryrefslogtreecommitdiffstats
path: root/SiteSummary.pm
diff options
context:
space:
mode:
authorSteffen Joeris <white@debian.org>2006-09-10 05:46:36 +0000
committerSteffen Joeris <white@debian.org>2006-09-10 05:46:36 +0000
commit736c7de26739ed176879140376e888a08425cb9f (patch)
tree996af306617124ab13015c04c8e3da684b2a34d6 /SiteSummary.pm
parent4e49bc3e97566a60ba183b71a05cbbbdbbacd980 (diff)
downloadsitesummary-736c7de26739ed176879140376e888a08425cb9f.tar.gz
sitesummary-736c7de26739ed176879140376e888a08425cb9f.tar.bz2
sitesummary-736c7de26739ed176879140376e888a08425cb9f.tar.xz
* include code for reporting the debian-edu-version
Diffstat (limited to 'SiteSummary.pm')
-rw-r--r--SiteSummary.pm25
1 files changed, 22 insertions, 3 deletions
diff --git a/SiteSummary.pm b/SiteSummary.pm
index 2d5576b..d16c236 100644
--- a/SiteSummary.pm
+++ b/SiteSummary.pm
@@ -13,11 +13,15 @@ our @EXPORT = qw(
get_site
get_sitegroup
get_linux_kernel_ver
+ get_debian_edu_profile
get_debian_edu_ver
);
my $pwd = "/var/lib/sitesummary/entries"; # Path to the entries
+# File for debian-edu configuration
+my $debian_edu_config = "/etc/debian-edu/config";
+
sub get_filepath_current {
my ($hostid, $file) = @_;
return "$pwd/$hostid$file";
@@ -84,12 +88,11 @@ sub get_linux_kernel_ver {
sub get_debian_edu_profile {
# my $hostid = shift;
- my $debian_edu_config = "/etc/debian-edu/config";
if ( ! -e $debian_edu_config ) {
print STDERR "error: Missing $debian_edu_config file.\n";
return undef;
}
- if (open (FILE, $debian_edu_config)) {
+ if (open (FILE, $debian_edu_config)) {
while (<FILE>) {
chomp;
s/\#.+$//;
@@ -97,10 +100,26 @@ sub get_debian_edu_profile {
s/^"PROFILE=//;
return $_;
}
- }
+ }
close(FILE);
}
+sub get_debian_edu_ver {
+ if ( ! -e $debian_edu_config ) {
+ print STDERR "error: Missing $debian_edu_config file.\n";
+ return undef;
+ }
+ if (open (FILE, $debian_edu_config)) {
+ while (<FILE>) {
+ chomp;
+ s/\#.+$//;
+ next if not (/DEBIAN-EDU-VERSION/);
+ s/^"DEBIAN-EDU-VERSION=//;
+ return $_;
+ }
+ }
+}
+
sub for_all_hosts {
my $callback = shift;