my %sambasettings = ();
my %checked = ();
my %netsettings = ();
+my %ovpnsettings = ();
my $message = "";
my $errormessage = "";
my $shareentry = "";
my %selected= () ;
my $sharefile = "/var/ipfire/samba/shares";
&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
+&General::readhash("${General::swroot}/ovpn/settings", \%ovpnsettings);
my %servicenames =
(
- 'SMB Daemon' => 'smbd',
- 'NetBIOS Nameserver' => 'nmbd',
- 'Winbind Daemon' => 'winbindd'
+ 'SMB Daemon' => 'smbd',
+ 'NetBIOS Nameserver' => 'nmbd',
+ 'Winbind Daemon' => 'winbindd'
);
&Header::showhttpheaders();
$sambasettings{'WORKGRP'} = 'homeip.net';
$sambasettings{'NETBIOSNAME'} = 'IPFIRE';
$sambasettings{'SRVSTRING'} = 'Samba Server %v running on IPFire 2.0';
-$sambasettings{'INTERFACES'} = '';
+$sambasettings{'INTERFACES'} = 'eth0';
$sambasettings{'SECURITY'} = 'share';
$sambasettings{'OSLEVEL'} = '20';
$sambasettings{'PDC'} = 'off';
+$sambasettings{'GREEN'} = 'on';
+$sambasettings{'BLUE'} = 'off';
+$sambasettings{'ORANGE'} = 'off';
+$sambasettings{'VPN'} = 'off';
$sambasettings{'WINSSERV'} = '';
$sambasettings{'WINS'} = 'off';
### Values that have to be initialized
if ($sambasettings{'ACTION'} eq $Lang::tr{'save'})
{
- &General::writehash("${General::swroot}/samba/settings", \%sambasettings);
+ &General::writehash("${General::swroot}/samba/settings", \%sambasettings);
}
&General::readhash("${General::swroot}/samba/settings", \%sambasettings);
if ($errormessage) {
- &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
- print "<class name='base'>$errormessage\n";
- print " </class>\n";
- &Header::closebox();
+ &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
+ print "<class name='base'>$errormessage\n";
+ print " </class>\n";
+ &Header::closebox();
}
$checked{'PDC'}{'on'} = '';
$checked{'WINS'}{'on'} = '';
$checked{'WINS'}{'off'} = '';
$checked{'WINS'}{"$sambasettings{'WINS'}"} = 'checked';
+$checked{'GREEN'}{'on'} = '';
+$checked{'GREEN'}{'off'} = '';
+$checked{'GREEN'}{"$sambasettings{'GREEN'}"} = 'checked';
+$checked{'BLUE'}{'on'} = '';
+$checked{'BLUE'}{'off'} = '';
+$checked{'BLUE'}{"$sambasettings{'BLUE'}"} = 'checked';
+$checked{'ORANGE'}{'on'} = '';
+$checked{'ORANGE'}{'off'} = '';
+$checked{'ORANGE'}{"$sambasettings{'ORANGE'}"} = 'checked';
+$checked{'VPN'}{'on'} = '';
+$checked{'VPN'}{'off'} = '';
+$checked{'VPN'}{"$sambasettings{'VPN'}"} = 'checked';
+
+$selected{'MAPTOGUEST'}{'Never'} = '';
+$selected{'MAPTOGUEST'}{'Bad User'} = '';
+$selected{'MAPTOGUEST'}{'Bad Password'} = '';
+$selected{'MAPTOGUEST'}{$sambasettings{'MAPTOGUEST'}} = "selected='selected'";
+$selected{'SECURITY'}{'share'} = '';
+$selected{'SECURITY'}{'user'} = '';
+$selected{'SECURITY'}{'server'} = '';
+$selected{'SECURITY'}{'domain'} = '';
+$selected{'SECURITY'}{$sambasettings{'SECURITY'}} = "selected='selected'";
############################################################################################################################
############################################################################################################################
&Header::openbox('100%', 'center', 'Samba');
print <<END
- <table width='400px' cellspacing='0'>
+ <table width='400px' cellspacing='0'>
END
;
- if ( $message ne "" ) {
- print "<tr><td colspan='3' align='center'><font color='red'>$message</font>";
- }
-
- my $lines = 0;
- my $key = '';
- foreach $key (sort keys %servicenames)
- {
- if ($lines % 2) {
- print "<tr bgcolor='${Header::table1colour}'>\n"; }
- else {
- print "<tr bgcolor='${Header::table2colour}'>\n"; }
- print "<td align='left'>$key</td>\n";
- my $shortname = $servicenames{$key};
- my $status = &isrunning($shortname);
- print "$status\n";
- print <<END
- <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
- <input type='hidden' name='ACTION' value='restart $shortname'>
- <input type='image' src='/images/reload.gif'>
- </form></td>
+ if ( $message ne "" ) {
+ print "<tr><td colspan='3' align='center'><font color='red'>$message</font>";
+ }
+
+ my $lines = 0;
+ my $key = '';
+ foreach $key (sort keys %servicenames)
+ {
+ if ($lines % 2) {
+ print "<tr bgcolor='${Header::table1colour}'>\n"; }
+ else {
+ print "<tr bgcolor='${Header::table2colour}'>\n"; }
+ print "<td align='left'>$key</td>\n";
+ my $shortname = $servicenames{$key};
+ my $status = &isrunning($shortname);
+ print "$status\n";
+ print <<END
+ <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+ <input type='hidden' name='ACTION' value='restart $shortname'>
+ <input type='image' src='/images/reload.gif'>
+ </form></td>
END
;
- print "</tr>\n";
- $lines++;
- }
- print <<END
- <form method='post' action='$ENV{'SCRIPT_NAME'}'>
- <tr><td><b>Alle Dienste:</b></td><td colspan='2'>
- <input type='submit' name='ACTION' value='Start' />
- <input type='submit' name='ACTION' value='Stop' />
- <input type='submit' name='ACTION' value='$Lang::tr{'restart'}' />
- </td></tr></form>
- </table>
- <hr>
- <form method='post' action='$ENV{'SCRIPT_NAME'}'>
- <table width='500px'>
- <tr><td colspan='2' align='left'><b>Basisoptionen</b>
- <tr><td align='left'>Workgroup:<td><input type='text' name='WORKGRP' value='$sambasettings{'WORKGRP'}'>
- <tr><td align='left'>NetBIOS-Name:<td><input type='text' name='NETBIOSNAME' value='$sambasettings{'NETBIOSNAME'}'>
- <tr><td align='left'>Server-String:<td><input type='text' name='SRVSTRING' value='$sambasettings{'SRVSTRING'}'>
- <tr><td align='left'>Interfaces:<td><select name='INTERFACES'>
- <option value='$netsettings{'GREEN_DEV'}'>GREEN</option>
+ print "</tr>\n";
+ $lines++;
+ }
+ print <<END
+ <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+ <tr><td><b>Alle Dienste:</b></td><td colspan='2'>
+ <input type='submit' name='ACTION' value='Start' />
+ <input type='submit' name='ACTION' value='Stop' />
+ <input type='submit' name='ACTION' value='$Lang::tr{'restart'}' />
+ </td></tr></form>
+ </table>
+ <hr>
+ <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+ <table width='500px'>
+ <tr><td colspan='2' align='left'>
+ <tr><td colspan='2' align='left'>
+ <tr><td colspan='2' align='left'><b>Basisoptionen</b>
+ <tr><td align='left'>Workgroup:<td><input type='text' name='WORKGRP' value='$sambasettings{'WORKGRP'}'>
+ <tr><td align='left'>NetBIOS-Name:<td><input type='text' name='NETBIOSNAME' value='$sambasettings{'NETBIOSNAME'}'>
+ <tr><td align='left'>Server-String:<td><input type='text' name='SRVSTRING' value='$sambasettings{'SRVSTRING'}'>
+ <tr><td align='left'>Interfaces:<td><input type='checkbox' name='VPN' $checked{'VPN'}{'on'}><font size='2' color='$Header::colourovpn'><b> OpenVpn - $ovpnsettings{'DDEVICE'}
+ <tr><td align='left'><td><input type='checkbox' name='GREEN' $checked{'GREEN'}{'on'}><font size='2' color='$Header::colourgreen'><b> $Lang::tr{'green'} - $netsettings{'GREEN_DEV'}
END
;
- if (&Header::blue_used()){
- print <<END
- <option value='$netsettings{'BLUE_DEV'}'>BLUE</option>
- <option value='$netsettings{'GREEN_DEV'},$netsettings{'BLUE_DEV'}'>GREEN & BLUE</option>
+ if (&Header::blue_used()){
+ print <<END
+ <tr><td align='left'><td><input type='checkbox' name='BLUE' $checked{'BLUE'}{'on'}><font size='2' color='$Header::colourblue'><b> $Lang::tr{'wireless'} - $netsettings{'BLUE_DEV'}
END
;
- }
- print <<END
+ }
+ if (&Header::orange_used()){
+ print <<END
+ <tr><td align='left'><td><input type='checkbox' name='ORANGE' $checked{'ORANGE'}{'on'}><font size='2' color='$Header::colourorange'><b> $Lang::tr{'dmz'} - $netsettings{'ORANGE_DEV'}
+END
+;
+ }
+ print <<END
</select>
+ <tr><td colspan='2' align='left'>
+ <tr><td colspan='2' align='left'>
+ <tr><td colspan='2' align='left'><b>Sicherheitsoptionen</b>
+ <tr><td align='left'>Security:<td><select name='SECURITY'>
+ <option value='share' $selected{'SECURITY'}{'share'}>SHARE</option>
+ <option value='user' $selected{'SECURITY'}{'user'}>USER</option>
+ <option value='server' $selected{'SECURITY'}{'server'}>SERVER</option>
+ <option value='domain' $selected{'SECURITY'}{'domain'}>DOMAIN</option>
+ </select>
+
+ <tr><td colspan='2' align='left'>
+ <tr><td colspan='2' align='left'>
+ <tr><td colspan='2' align='left'><b>Browsingoptionen</b>
+ <tr><td align='left'>OS Level:<td><input type='text' name='OSLEVEL' value='$sambasettings{'OSLEVEL'}'>
+ <tr><td align='left'>Primary Domain Controller:<td>on <input type='radio' name='PDC' value='on' $checked{'PDC'}{'on'}>/
+ <input type='radio' name='PDC' value='off' $checked{'PDC'}{'off'}> off
- <tr><td colspan='2' align='left'><b>Sicherheitsoptionen</b>
- <tr><td align='left'>Security:<td><select name='SECURITY'>
- <option value='share'>SHARE</option>
- <option value='user'>USER</option>
- <option value='server'>SERVER</option>
- <option value='domain'>DOMAIN</option>
- </select>
-
- <tr><td colspan='2' align='left'><b>Browsingoptionen</b>
- <tr><td align='left'>OS Level:<td><input type='text' name='OSLEVEL' value='$sambasettings{'OSLEVEL'}'>
- <tr><td align='left'>Primary Domain Controller:<td>on <input type='radio' name='PDC' value='on' $checked{'PDC'}{'on'}>/
- <input type='radio' name='PDC' value='off' $checked{'PDC'}{'off'}> off
-
- <tr><td colspan='2' align='left'><b>WINS-Optionen</b>
- <tr><td align='left'>WINS-Server:<td><input type='text' name='WINSSRV' value='$sambasettings{'WINSSRV'}'>
- <tr><td align='left'>WINS-Support:<td>on <input type='radio' name='WINS' value='on' $checked{'WINS'}{'on'}>/
- <input type='radio' name='WINS' value='off' $checked{'WINS'}{'off'}> off
-
- <tr><td colspan='2' align='right'><input type='submit' name='ACTION' value=$Lang::tr{'save'}>
- </table>
- </form>
+ <tr><td colspan='2' align='left'>
+ <tr><td colspan='2' align='left'>
+ <tr><td colspan='2' align='left'><b>WINS-Optionen</b>
+ <tr><td align='left'>WINS-Server:<td><input type='text' name='WINSSRV' value='$sambasettings{'WINSSRV'}'>
+ <tr><td align='left'>WINS-Support:<td>on <input type='radio' name='WINS' value='on' $checked{'WINS'}{'on'}>/
+ <input type='radio' name='WINS' value='off' $checked{'WINS'}{'off'}> off
+
+ <tr><td colspan='1' align='right'><input type='submit' name='ACTION' value=$Lang::tr{'save'}>
+ </table>
+ </form>
END
;
&Header::closebox();
&Header::openbox('100%', 'center', 'Shares');
print <<END
- <table width='500'>
- <tr><th width='40%'>Name der Freigabe<th width='40%'>Pfad<th width='20%'>Optionen
+ <hr>
+ <table width='500'>
+ <tr><th width='40%'>Name der Freigabe<th width='40%'>Pfad<th width='20%'>Optionen
+END
+;
+ open( FILE, "< $sharefile" ) or die "Unable to read $sharefile";
+ @shares = <FILE>;
+ close FILE;
+ foreach $shareentry (sort @shares)
+ {
+ @shareline = split( /\;/, $shareentry );
+ print <<END
+ <tr><td align='center' bgcolor='#EAEAEA'><b>$shareline[0]</b>
+ <td align='center' bgcolor='#EAEAEA'>$shareline[2]
+ <td align='right' bgcolor='#EAEAEA'>
+ <table border='0'><tr>
END
;
- open( FILE, "< $sharefile" ) or die "Unable to read $sharefile";
- @shares = <FILE>;
- close FILE;
- foreach $shareentry (sort @shares)
- {
- @shareline = split( /\;/, $shareentry );
- print <<END
- <tr><td align='center' bgcolor='#EAEAEA'><b>$shareline[0]</b>
- <td align='center' bgcolor='#EAEAEA'>$shareline[2]
- <td align='right' bgcolor='#EAEAEA'>
- <table border='0'><tr>
+ if ($shareline[1] eq 'enabled') {
+ print <<END
+ <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+ <input type='hidden' name='NAME' value='shareline[0]'>
+ <input type='hidden' name='ACTION' value='disable'>
+ <input type='image' alt='Ausschalten' src='/images/on.gif'>
+ </form>
END
;
- if ($shareline[1] eq 'enabled') {
- print <<END
- <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
- <input type='hidden' name='NAME' value='shareline[0]'>
- <input type='hidden' name='ACTION' value='disable'>
- <input type='image' alt='Ausschalten' src='/images/on.gif'>
- </form>
+ } elsif ($shareline[1] eq 'disabled') {
+ print <<END
+ <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+ <input type='hidden' name='NAME' value='shareline[0]'>
+ <input type='hidden' name='ACTION' value='enable'>
+ <input type='image' alt='Einschalten' src='/images/off.gif'>
+ </form>
END
;
- } elsif ($shareline[1] eq 'disabled') {
- print <<END
- <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
- <input type='hidden' name='NAME' value='shareline[0]'>
- <input type='hidden' name='ACTION' value='enable'>
- <input type='image' alt='Einschalten' src='/images/off.gif'>
- </form>
+ }
+ print <<END
+ <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+ <input type='hidden' name='NAME' value='shareline[0]'>
+ <input type='hidden' name='ACTION' value='Bearbeiten'>
+ <input type='image' alt='Bearbeiten' src='/images/edit.gif'>
+ </form>
+ <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
+ <input type='hidden' name='NAME' value='shareline[0]'>
+ <input type='hidden' name='ACTION' value='Loeschen'>
+ <input type='image' alt='Loeschen' src='/images/delete.gif'>
+ </form>
+ </table>
END
;
- }
- print <<END
- <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
- <input type='hidden' name='NAME' value='shareline[0]'>
- <input type='hidden' name='ACTION' value='Bearbeiten'>
- <input type='image' alt='Bearbeiten' src='/images/edit.gif'>
- </form>
- <td><form method='post' action='$ENV{'SCRIPT_NAME'}'>
- <input type='hidden' name='NAME' value='shareline[0]'>
- <input type='hidden' name='ACTION' value='Loeschen'>
- <input type='image' alt='Loeschen' src='/images/delete.gif'>
- </form>
- </table>
+ }
+ print <<END
+ <tr><td colspan='8' align='right' valign='middle'><b>Legende:</b> <img src='/images/edit.gif'> Freigabe bearbeiten | <img src='/images/delete.gif'> Freigabe loeschen
+ </table>
END
;
- }
- print <<END
- <tr><td colspan='8' align='right' valign='middle'><b>Legende:</b> <img src='/images/edit.gif'> Freigabe bearbeiten | <img src='/images/delete.gif'> Freigabe loeschen
- </table>
+
+&Header::closebox();
+
+
+if ($sambasettings{'SECURITY'} eq 'user')
+{
+&Header::openbox('100%', 'center', 'User');
+
+print <<END
+ <hr>
+ <table width='500'>
+ <tr><td colspan='2' align='left'>
+ <tr><td colspan='2' align='left'><b>Benutzerverwaltung</b>
+ </table>
END
;
&Header::closebox();
+}
&Header::closebigbox();
&Header::closepage();
sub isrunning
{
- my $cmd = $_[0];
- my $status = "<td bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>";
- my $pid = '';
- my $testcmd = '';
- my $exename;
-
- $cmd =~ /(^[a-z]+)/;
- $exename = $1;
-
- if (open(FILE, "/var/run/${cmd}.pid"))
- {
- $pid = <FILE>; chomp $pid;
- close FILE;
- if (open(FILE, "/proc/${pid}/status"))
- {
- while (<FILE>)
- {
- if (/^Name:\W+(.*)/) {
- $testcmd = $1; }
- }
- close FILE;
- if ($testcmd =~ /$exename/)
- {
- $status = "<td bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>";
- }
- }
- }
-
- return $status;
-}
+ my $cmd = $_[0];
+ my $status = "<td bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>";
+ my $pid = '';
+ my $testcmd = '';
+ my $exename;
+
+ $cmd =~ /(^[a-z]+)/;
+ $exename = $1;
+ if (open(FILE, "/var/run/${cmd}.pid"))
+ {
+ $pid = <FILE>; chomp $pid;
+ close FILE;
+ if (open(FILE, "/proc/${pid}/status"))
+ {
+ while (<FILE>)
+ {
+ if (/^Name:\W+(.*)/) {
+ $testcmd = $1; }
+ }
+ close FILE;
+ if ($testcmd =~ /$exename/)
+ {
+ $status = "<td bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>";
+ }
+ }
+ }
+
+ return $status;
+}
--- /dev/null
+#!/usr/bin/perl
+#
+# IPFire CGIs
+#
+# This code is distributed under the terms of the GPL
+#
+# (c) The IPFire Team
+#
+
+use strict;
+# enable only the following on debugging purpose
+use warnings;
+use CGI::Carp 'fatalsToBrowser';
+
+require '/var/ipfire/general-functions.pl';
+require "${General::swroot}/lang.pl";
+require "${General::swroot}/header.pl";
+
+my %upnpsettings = ();
+my %checked = ();
+my %netsettings = ();
+my $message = "";
+my $errormessage = "";
+my %selected= () ;
+&General::readhash("${General::swroot}/ethernet/settings", \%netsettings);
+
+my %servicenames =
+(
+ 'UPnP Daemon' => 'upnpd',
+);
+
+&Header::showhttpheaders();
+
+$upnpsettings{'ENABLED'} = 'off';
+$upnpsettings{'GREEN'} = 'on';
+$upnpsettings{'BLUE'} = 'off';
+### Values that have to be initialized
+$upnpsettings{'ACTION'} = '';
+
+&General::readhash("${General::swroot}/upnp/settings", \%upnpsettings);
+&Header::getcgihash(\%upnpsettings);
+
+&Header::openpage('UPnP', 1, '');
+&Header::openbigbox('100%', 'left', '', $errormessage);
+
+############################################################################################################################
+############################################################################################################################
+
+if ($upnpsettings{'ACTION'} eq $Lang::tr{'save'})
+{
+ &General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
+}
+elsif ($upnpsettings{'ACTION'} eq 'Start')
+{
+ $upnpsettings{'ENABLED'} = 'on';
+ &General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
+ system('/usr/local/bin/upnpctrl start');
+}
+elsif ($upnpsettings{'ACTION'} eq 'Stop')
+{
+ $upnpsettings{'ENABLED'} = 'off';
+ &General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
+ system('/usr/local/bin/upnpctrl stop');
+}
+elsif ($upnpsettings{'ACTION'} eq $Lang::tr{'restart'})
+{
+ &General::writehash("${General::swroot}/upnp/settings", \%upnpsettings);
+ system('/usr/local/bin/upnpctrl restart');
+}
+
+&General::readhash("${General::swroot}/upnp/settings", \%upnpsettings);
+
+if ($errormessage) {
+ &Header::openbox('100%', 'left', $Lang::tr{'error messages'});
+ print "<class name='base'>$errormessage\n";
+ print " </class>\n";
+ &Header::closebox();
+}
+
+$checked{'GREEN'}{'on'} = '';
+$checked{'GREEN'}{'off'} = '';
+$checked{'GREEN'}{"$upnpsettings{'GREEN'}"} = 'checked';
+$checked{'BLUE'}{'on'} = '';
+$checked{'BLUE'}{'off'} = '';
+$checked{'BLUE'}{"$upnpsettings{'BLUE'}"} = 'checked';
+
+############################################################################################################################
+############################################################################################################################
+
+&Header::openbox('100%', 'center', 'UPnP');
+print <<END
+ <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+ <table width='400' cellspacing='0'>
+END
+;
+ if ( $message ne "" ) {
+ print "<tr><td colspan='3' align='center'><font color='red'>$message</font>";
+ }
+
+ my $lines = 0;
+ my $key = '';
+ foreach $key (sort keys %servicenames)
+ {
+ if ($lines % 2) {
+ print "<tr bgcolor='${Header::table1colour}'>\n"; }
+ else {
+ print "<tr bgcolor='${Header::table2colour}'>\n"; }
+ print "<td align='left'>$key\n";
+ my $shortname = $servicenames{$key};
+ my $status = &isrunning($shortname);
+ print "$status\n";
+ $lines++;
+ }
+ print <<END
+ <tr><td><b>Alle Dienste:</b></td><td colspan='2'>
+ <input type='submit' name='ACTION' value='Start' />
+ <input type='submit' name='ACTION' value='Stop' />
+ <input type='submit' name='ACTION' value='$Lang::tr{'restart'}' />
+ </table>
+ </form>
+ <hr />
+ <form method='post' action='$ENV{'SCRIPT_NAME'}'>
+ <table width='500'>
+ <tr><td colspan='2' align='left'><b>$Lang::tr{'options'}</b>
+ <tr><td align='left'>$Lang::tr{'interfaces'}
+ <td align='left'> <td><input type='checkbox' name='GREEN' $checked{'GREEN'}{'on'} /> <font size='2' color='$Header::colourgreen'><b>$Lang::tr{'green'} - $netsettings{'GREEN_DEV'}</b></font>
+END
+;
+ if (&Header::blue_used()){
+ print <<END
+ <tr><td align='left'> <td><input type='checkbox' name='BLUE' $checked{'BLUE'}{'on'} /> <font size='2' color='$Header::colourblue'><b>$Lang::tr{'wireless'} - $netsettings{'BLUE_DEV'}</b></font>
+END
+;
+ }
+ print <<END
+ <tr><td colspan='2' align='right'><input type='submit' name='ACTION' value=$Lang::tr{'save'} />
+ </table>
+ </form>
+END
+;
+&Header::closebox();
+
+&Header::closebigbox();
+&Header::closepage();
+
+############################################################################################################################
+############################################################################################################################
+
+sub isrunning
+{
+ my $cmd = $_[0];
+ my $status = "<td bgcolor='${Header::colourred}'><font color='white'><b>$Lang::tr{'stopped'}</b></font></td>";
+ my $pid = '';
+ my $testcmd = '';
+ my $exename;
+
+ $cmd =~ /(^[a-z]+)/;
+ $exename = $1;
+
+ if (open(FILE, "/var/run/${cmd}.pid"))
+ {
+ $pid = <FILE>; chomp $pid;
+ close FILE;
+ if (open(FILE, "/proc/${pid}/status"))
+ {
+ while (<FILE>)
+ {
+ if (/^Name:\W+(.*)/) {
+ $testcmd = $1; }
+ }
+ close FILE;
+ if ($testcmd =~ /$exename/)
+ {
+ $status = "<td bgcolor='${Header::colourgreen}'><font color='white'><b>$Lang::tr{'running'}</b></font></td>";
+ }
+ }
+ }
+
+ return $status;
+}
+