aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--SiteSummary.pm25
-rw-r--r--debian/changelog6
-rwxr-xr-xdebian_edu-summary8
3 files changed, 32 insertions, 7 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;
diff --git a/debian/changelog b/debian/changelog
index bffc0ee..d70f965 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,10 +3,12 @@ sitesummary (0.0.8) terra; urgency=low
[ Steffen Joeris ]
* Add missing dependency for sitesummary against apache2-common
which is needed for a2dissite in the postinst script
- * Write subroutine for debian_edu_vers which is needed for the
- debian-edu report
+ * Write subroutine for debian_edu_profile which is needed for the
+ debian-edu report to reflect the profile
* Add debian_edu-summary script and adjust Makefile and the
sitesummary-makewebreport script
+ * Write subroutine for debian_edu_vers to reflect the current
+ debian-edu-version
-- Steffen Joeris <steffen.joeris@skolelinux.de> Tue, 5 Sep 2006 21:21:24 +1000
diff --git a/debian_edu-summary b/debian_edu-summary
index a2c73db..265f05d 100755
--- a/debian_edu-summary
+++ b/debian_edu-summary
@@ -9,8 +9,12 @@ use SiteSummary;
handle_host();
sub handle_host {
my $hostid = shift;
- printf(" %-20s %5s\n", "debian-edu-version", "count");
+ printf(" %-20s %5s\n", "debian-edu-profile", "count");
foreach ( get_debian_edu_profile ) {
- printf(" %20s\n", "$_\n");
+ printf(" %20s\n", "$_\n");
+ }
+ printf(" %-20s %5s\n", "debian-edu-version", "count");
+ foreach ( get_debian_edu_version ) {
+ printf(" %20s\n", "$_\n");
}
}