aboutsummaryrefslogtreecommitdiffstats
path: root/SiteSummary.pm
diff options
context:
space:
mode:
Diffstat (limited to 'SiteSummary.pm')
-rw-r--r--SiteSummary.pm30
1 files changed, 29 insertions, 1 deletions
diff --git a/SiteSummary.pm b/SiteSummary.pm
index 9094c13..1469f5d 100644
--- a/SiteSummary.pm
+++ b/SiteSummary.pm
@@ -12,7 +12,8 @@ our @EXPORT = qw(
get_filepath_current
get_site
get_sitegroup
- get_linux_kernel_ver
+ get_linux_kernel_ver
+ get_debian_edu_ver
);
my $pwd = "/var/lib/sitesummary/entries"; # Path to the entries
@@ -81,6 +82,33 @@ sub get_linux_kernel_ver {
}
}
+sub get_debian_edu_ver {
+# 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;
+ }
+ my $profiles = "Main-Server Workstation Thin-Client-Server Standalone";
+ my @profile = split(/ /, $profiles);
+ open(FILE, $debian_edu_config) or die "$!: $debian_edu_config\nDied";
+ while ( my @config = <FILE> ) {
+ if ( "@config" =~ "$profile[0]" ) {
+ return $profile[0];
+ }elsif ( "@config" =~ "$profile[1]" ) {
+ return $profile[1];
+ }elsif ( "@config" =~ "$profile[2]" ) {
+ return $profile[2];
+ }elsif ( "@config" =~ "$profile[3]" ) {
+ return $profile[3];
+ }else{
+ print STDERR "error: Can't determine debian-edu profile.\n";
+ return undef;
+ }
+ }
+ close(FILE);
+}
+
sub for_all_hosts {
my $callback = shift;