aboutsummaryrefslogtreecommitdiffstats
path: root/SiteSummary.pm
diff options
context:
space:
mode:
authorSteffen Joeris <white@debian.org>2006-09-05 12:48:09 +0000
committerSteffen Joeris <white@debian.org>2006-09-05 12:48:09 +0000
commit7a0521cf2cab8bcd9ea5298e66915ea809a91ca3 (patch)
tree82253ab02005e486974fb69d2b28572378373e6f /SiteSummary.pm
parentd4775878704a662f241afdf3e8f7819554992104 (diff)
downloadsitesummary-7a0521cf2cab8bcd9ea5298e66915ea809a91ca3.tar.gz
sitesummary-7a0521cf2cab8bcd9ea5298e66915ea809a91ca3.tar.bz2
sitesummary-7a0521cf2cab8bcd9ea5298e66915ea809a91ca3.tar.xz
* add debian_edu-summary and the subroutine for the package
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;