]>
git.ipfire.org Git - ipfire-2.x.git/blob - html/cgi-bin/addonsvc.cgi
2 ###############################################################################
4 # IPFire.org - A linux based firewall #
5 # Copyright (C) 2007 Michael Tremer & Christian Schmidt #
7 # This program is free software: you can redistribute it and/or modify #
8 # it under the terms of the GNU General Public License as published by #
9 # the Free Software Foundation, either version 3 of the License, or #
10 # (at your option) any later version. #
12 # This program is distributed in the hope that it will be useful, #
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of #
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
15 # GNU General Public License for more details. #
17 # You should have received a copy of the GNU General Public License #
18 # along with this program. If not, see <http://www.gnu.org/licenses/>. #
20 ###############################################################################
24 # enable only the following on debugging purpose
26 #use CGI::Carp 'fatalsToBrowser';
28 require '/var/ipfire/general-functions.pl';
29 require "${General::swroot}/lang.pl";
30 require "${General::swroot}/header.pl";
32 #workaround to suppress a warning when a variable is used only once
33 my @dummy = ( ${Header
::colourred
} );
37 my %mainsettings = ();
38 &General
::readhash
("${General::swroot}/main/settings", \
%mainsettings);
39 &General
::readhash
("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \
%color);
43 &Header
::showhttpheaders
();
44 &Header
::getcgihash
(\
%cgiparams);
45 &Header
::openpage
($Lang::tr
{'status information'}, 1, '');
46 &Header
::openbigbox
('100%', 'left');
48 &Header
::openbox
('100%', 'left', 'Addon - Services');
50 my $paramstr=$ENV{QUERY_STRING
};
51 my @param=split(/!/, $paramstr);
52 if ($param[1] ne '') {
53 my $temp = `/usr/local/bin/addonctrl @param[0] @param[1]`;
58 <table width='90%' cellspacing='2' border='0'>
59 <tr bgcolor='$color{'color20'}'>
60 <td align='left'><b>Addon</b></td>
61 <td align='center' colspan=3><b>Bootconfiguration</b></td>
62 <td align='center' colspan=2><b>Manual</b></td>
63 <td align='left' width='50%'><b>Status</b></td>
68 my $lines=0; # Used to count the outputlines to make different bgcolor
70 # Generate list of installed addon pak's
71 my @pak = `find /opt/pakfire/db/installed/meta-* | cut -d"-" -f2`;
76 # Check which of the paks are services
77 my @svc = `find /etc/init.d/$_ | cut -d"/" -f4`;
80 # blacklist some packages
82 # alsa has trouble with the volume saving and was not really stopped
90 print "<tr bgcolor='$color{'color22'}'>";
94 print "<tr bgcolor='$color{'color20'}'>";
96 print "<td align='left'>$_</td> ";
97 my $status = isautorun
($_);
99 print "<td align='center'><A HREF=addonsvc.cgi?$_!enable>enable</A></td> ";
100 print "<td align='center'><A HREF=addonsvc.cgi?$_!disable>disable</A></td> ";
101 print "<td align='center'><A HREF=addonsvc.cgi?$_!start>start</A></td> ";
102 print "<td align='center'><A HREF=addonsvc.cgi?$_!stop>stop</A></td> ";
103 my $status = `/usr/local/bin/addonctrl $_ status`;
104 $status =~ s/\\e\[[0-1]\;[0-9]+m//g;
106 print "<td align='left'>$status</td> ";
112 print "</table></div>\n";
115 &Header
::closebigbox
();
116 &Header
::closepage
();
121 my $status = "<td align='center' bgcolor='${Header::colourblue}'><font color='white'><b>---</b></font></td>";
122 my $init = `find /etc/rc.d/rc3.d/S??${cmd}`;
125 $status = "<td align='center' bgcolor='${Header::colourgreen}'><font color='white'><b>Ein</b></font></td>";
127 $init = `find /etc/rc.d/rc3.d/off/S??${cmd}`;
130 $status = "<td align='center' bgcolor='${Header::colourred}'><font color='white'><b>Aus</b></font></td>";