X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fservices.cgi;fp=html%2Fcgi-bin%2Fservices.cgi;h=29926ecc32021829171358d12135de75ea5a75d2;hp=a1dcfd57e8ccf79a469adf38c4293d47d58ef85c;hb=5cc18f9c12bc4aaec6075af1a20c5f8ef0347bf4;hpb=2be67e384101f152b37b4bfc6dc1927414021d66 diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi index a1dcfd57e8..29926ecc32 100644 --- a/html/cgi-bin/services.cgi +++ b/html/cgi-bin/services.cgi @@ -29,6 +29,7 @@ require '/var/ipfire/general-functions.pl'; require "${General::swroot}/lang.pl"; require "${General::swroot}/header.pl"; require "${General::swroot}/graphs.pl"; +require "/opt/pakfire/lib/functions.pl"; my %color = (); my %mainsettings = (); @@ -160,51 +161,44 @@ END my $lines=0; # Used to count the outputlines to make different bgcolor - # Generate list of installed addon pak's - opendir (DIR, "/opt/pakfire/db/installed") || die "Cannot opendir /opt/pakfire/db/installed/: $!"; - my @pak = sort readdir DIR; - closedir(DIR); - - foreach (@pak){ - chomp($_); - next unless (m/^meta-/); - s/^meta-//; - - # Check which of the paks are services - if (-e "/etc/init.d/$_") { - # blacklist some packages - # - # alsa has trouble with the volume saving and was not really stopped - # mdadm should not stopped with webif because this could crash the system - # - if ( $_ eq 'squid' ) { - next; - } - if ( ($_ ne "alsa") && ($_ ne "mdadm") ) { - $lines++; - if ($lines % 2){ - print ""; - $col="bgcolor='$color{'color22'}'"; - }else{ - print ""; - $col="bgcolor='$color{'color20'}'"; - } + my @paks; + my @addon_services; + + # Generate list of installed addon pak services + my %paklist = &Pakfire::dblist("installed"); - print "$_ "; - my $status = isautorun($_,$col); - print "$status "; - print "$Lang::tr{"; - print "$Lang::tr{ "; - my $status = &isrunningaddon($_,$col); - $status =~ s/\\[[0-1]\;[0-9]+m//g; - - chomp($status); - print "$status"; - print ""; + foreach my $pak (keys %paklist) { + my %metadata = &Pakfire::getmetadata($pak, "installed"); + + if ("$metadata{'Services'}") { + foreach my $service (split(/ /, "$metadata{'Services'}")) { + push(@addon_services, $service); } } } + foreach (@addon_services) { + $lines++; + if ($lines % 2){ + print ""; + $col="bgcolor='$color{'color22'}'"; + }else{ + print ""; + $col="bgcolor='$color{'color20'}'"; + } + print "$_ "; + my $status = isautorun($_,$col); + print "$status "; + print "$Lang::tr{"; + print "$Lang::tr{ "; + my $status = isrunningaddon($_,$col); + $status =~ s/\\[[0-1]\;[0-9]+m//g; + + chomp($status); + print "$status"; + print ""; + } + print "\n"; &Header::closebox();