-if ($sort_dir eq 'asc' && $sort_col eq '2') {
- print "<TD WIDTH='25%'><strong><a href='services.cgi?sortcol=2&srtype=a&srtdir=dsc' title='$Lang::tr{'sort descending'}'>$Lang::tr{'servicename'}</a></strong></TD>\n";
-} else {
- print "<TD WIDTH='25%'><strong><a href='services.cgi?sortcol=2&srtype=a&srtdir=asc' title='$Lang::tr{'sort ascending'}'>$Lang::tr{'servicename'}</a></strong></TD>\n";
-}
-if ($sort_dir eq 'asc' && $sort_col eq '3') {
- print "<TD WIDTH='25%'><strong><a href='services.cgi?sortcol=3&srtype=n&srtdir=dsc' title='$Lang::tr{'sort descending'}'>$Lang::tr{'ports'}</a></strong></TD>\n";
-} else {
- print "<TD WIDTH='25%'><strong><a href='services.cgi?sortcol=3&srtype=n&srtdir=asc' title='$Lang::tr{'sort ascending'}'>$Lang::tr{'ports'}</a></strong></TD>\n";
-}
-if ($sort_dir eq 'asc' && $sort_col eq '4') {
- print "<TD WIDTH='25%'><strong><a href='services.cgi?sortcol=4&srtype=a&srtdir=dsc' title='$Lang::tr{'sort descending'}'>$Lang::tr{'protocol'}</a></strong></TD>\n";
-} else {
- print "<TD WIDTH='25%'><strong><a href='services.cgi?sortcol=4&srtype=a&srtdir=asc' title='$Lang::tr{'sort ascending'}'>$Lang::tr{'protocol'}</a></strong></TD>\n";
-}
-
-print <<END
- <TD WIDTH='25%'><strong>$Lang::tr{'icmp type'}</strong></TD>
- <TD WIDTH='5%'> </TD>
- <TD WIDTH='5%'> </TD>
-</TR>
-END
-;
-&display_custom_services();
-print <<END
-</TABLE>
-</DIV>
-END
-;
-&Header::closebox();
-
-&Header::openbox('100%', 'LEFT', "$Lang::tr{'default services'}:");
-print <<END
-<DIV ALIGN='CENTER'>
-<TABLE WIDTH='100%' ALIGN='CENTER'>
-<TR align="center">
- <TD><strong>$Lang::tr{'servicename'}</strong></TD>
- <TD><strong>$Lang::tr{'ports'}</strong></TD>
- <TD><strong>$Lang::tr{'protocol'}</strong></TD>
-</TR>
-END
-;
-&display_default_services();
-print <<END
-</TABLE>
-</DIV>
-END
-;
-&Header::closebox();
-
- print "$Lang::tr{'this feature has been sponsored by'} : ";
- print "<A HREF='http://www.kdi.ca/' TARGET='_blank'>Kobelt Development Inc.</A>.\n";
-
-
-&Header::closebigbox();
-
-&Header::closepage();
-
-sub display_custom_services
-{
-
- open(FILE, "$filename") or die 'Unable to open services file.';
- my @current = <FILE>;
- close(FILE);
-
- my $id = 0;
- my $port_inv = '';
- my $prot_inv = '';
- my $port_inv_tail = '';
- my $prot_inv_tail = '';
- my @outarray = &General::srtarray($sort_col,$sort_type,$sort_dir,@current);
- foreach $line (@outarray)
- {
- chomp($line);
- if ($line ne ''){
- my @temp = split(/\,/,$line);
- # Darren Critchley highlight the row we are editing
- if ( $cgiparams{'ACTION'} eq $Lang::tr{'edit'} && $cgiparams{'KEY'} eq $temp[0] ) {
- print "<TR BGCOLOR='${Header::colouryellow}'>\n";
- } else {
- if ($id % 2) {
- print "<TR BGCOLOR='${Header::table1colour}'>\n";
- } else {
- print "<TR BGCOLOR='${Header::table2colour}'>\n";
+ my $lines=0; # Used to count the outputlines to make different bgcolor
+
+ # Generate list of installed addon pak's
+ my @pak = `find /opt/pakfire/db/installed/meta-* 2>/dev/null | cut -d"-" -f2`;
+ foreach (@pak){
+ chomp($_);
+
+ # Check which of the paks are services
+ my @svc = `find /etc/init.d/$_ 2>/dev/null | cut -d"/" -f4`;
+ foreach (@svc){
+ # blacklist some packages
+ #
+ # alsa has trouble with the volume saving and was not really stopped
+ #
+ chomp($_);
+ if ($_ ne "alsa"){
+ $lines++;
+ if ($lines % 2){
+ print "<tr bgcolor='$color{'color22'}'>";
+ }else{
+ print "<tr bgcolor='$color{'color20'}'>";