X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=html%2Fcgi-bin%2Fservices.cgi;h=22a9ac707cce13d072c261398fae6c9ed8a25234;hb=e218d500dd4e7d17591df9c449387c00359ee728;hp=dcd306ef7961af357bce4a7ef087af4894b27f3c;hpb=824a0f689e6269c178e54feeaba878078bb6a49b;p=people%2Fteissler%2Fipfire-2.x.git diff --git a/html/cgi-bin/services.cgi b/html/cgi-bin/services.cgi index dcd306ef7..22a9ac707 100644 --- a/html/cgi-bin/services.cgi +++ b/html/cgi-bin/services.cgi @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2008 Michael Tremer & Christian Schmidt # +# Copyright (C) 2005-2010 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -54,11 +54,29 @@ my %servicenames =( $Lang::tr{'kernel logging server'} => 'klogd', $Lang::tr{'ntp server'} => 'ntpd', $Lang::tr{'secure shell server'} => 'sshd', - $Lang::tr{'vpn'} => 'pluto', + $Lang::tr{'vpn'} => 'charon', $Lang::tr{'web proxy'} => 'squid', 'OpenVPN' => 'openvpn' ); +my %link =( + $Lang::tr{'dhcp server'} => "$Lang::tr{'dhcp server'}", + $Lang::tr{'web server'} => $Lang::tr{'web server'}, + $Lang::tr{'cron server'} => $Lang::tr{'cron server'}, + $Lang::tr{'dns proxy server'} => $Lang::tr{'dns proxy server'}, + $Lang::tr{'logging server'} => $Lang::tr{'logging server'}, + $Lang::tr{'kernel logging server'} => $Lang::tr{'kernel logging server'}, + $Lang::tr{'ntp server'} => "$Lang::tr{'ntp server'}", + $Lang::tr{'secure shell server'} => "$Lang::tr{'secure shell server'}", + $Lang::tr{'vpn'} => "$Lang::tr{'vpn'}", + $Lang::tr{'web proxy'} => "$Lang::tr{'web proxy'}", + 'OpenVPN' => "OpenVPN", + "$Lang::tr{'intrusion detection system'} (GREEN)" => "$Lang::tr{'intrusion detection system'} (GREEN)", + "$Lang::tr{'intrusion detection system'} (RED)" => "$Lang::tr{'intrusion detection system'} (RED)", + "$Lang::tr{'intrusion detection system'} (ORANGE)" => "$Lang::tr{'intrusion detection system'} (ORANGE)", + "$Lang::tr{'intrusion detection system'} (BLUE)" => "$Lang::tr{'intrusion detection system'} (BLUE)" +); + my $lines=0; # Used to count the outputlines to make different bgcolor my $iface = ''; @@ -106,9 +124,13 @@ END foreach $key (sort keys %servicenames){ $lines++; if ($lines % 2){ - print "\n$key\n"; + print "\n"; + print %link->{$key}; + print "\n"; }else{ - print "\n$key\n"; + print "\n"; + print %link->{$key}; + print "\n"; } my $shortname = $servicenames{$key}; @@ -155,9 +177,10 @@ END # 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 # chomp($_); - if ($_ ne "alsa"){ + if ( ($_ ne "alsa") && ($_ ne "mdadm") ) { $lines++; if ($lines % 2){ print ""; @@ -217,7 +240,7 @@ sub isrunning{ my $pid = ''; my $testcmd = ''; my $exename; - my @memory; + my $memory; $cmd =~ /(^[a-z]+)/; $exename = $1; @@ -233,13 +256,18 @@ sub isrunning{ } close FILE; } - if (open(FILE, "/proc/${pid}/statm")){ - my $temp = ; - @memory = split(/ /,$temp); + if (open(FILE, "/proc/${pid}/status")) { + while () { + my ($key, $val) = split(":", $_, 2); + if ($key eq 'VmRSS') { + $memory = $val; + last; + } + } + close(FILE); } - close FILE; if ($testcmd =~ /$exename/){ - $status = "$Lang::tr{'running'}$pid$memory[0] KB"; + $status = "$Lang::tr{'running'}$pid$memory"; } } return $status; @@ -253,10 +281,11 @@ sub isrunningaddon{ my $exename; my @memory; - my $testcmd = `/usr/local/bin/addonctrl $_ status`; + my $testcmd = `/usr/local/bin/addonctrl $_ status 2>/dev/null`; if ( $testcmd =~ /is\ running/ && $testcmd !~ /is\ not\ running/){ $status = "$Lang::tr{'running'}"; + $testcmd =~ s/.* //gi; $testcmd =~ s/[a-z_]//gi; $testcmd =~ s/\[[0-1]\;[0-9]+//gi; $testcmd =~ s/[\(\)\.]//gi;