1 |
--- smeserver-sme9admin-1.5/root/etc/e-smith/web/functions/sme9admin.errolog 2016-12-20 06:44:10.000000000 +0100 |
2 |
+++ smeserver-sme9admin-1.5/root/etc/e-smith/web/functions/sme9admin 2017-01-02 02:04:27.000000000 +0100 |
3 |
@@ -298,12 +298,12 @@ |
4 |
my $dev = $1; |
5 |
|
6 |
my @array = split(/ /); |
7 |
- for $_ (@array) { |
8 |
+ for $_ (@array) {warn $_; |
9 |
next if ! /(\w+)\[\d+\](\(.\))*/; |
10 |
- if ($2 eq "(F)") { |
11 |
+ if (defined $2 && $2 eq "(F)") { |
12 |
$failed_devs{$dev} .= "$1,"; |
13 |
} |
14 |
- elsif ($2 eq "(S)") { |
15 |
+ elsif (defined $2 && $2 eq "(S)") { |
16 |
$spare_devs{$dev} .= "$1,"; |
17 |
} |
18 |
else { |
19 |
@@ -369,10 +369,10 @@ |
20 |
my @services = ("#".gettext("Web services"),"httpd-e-smith","httpd-admin","squid", |
21 |
"#".gettext("Administrative services"), "sshd", "sme9admind", |
22 |
"#".gettext("Network services"),"wan","dhcpd","pptpd","ippp", |
23 |
- "#".gettext("File-sharing services"),"smb","smbd","nmbd","ftp","proftpd", |
24 |
- "#".gettext("E-mail services"),"pop3","pop3s","imaps","imap","dovecot","qmail","qpsmtpd","sqpsmtpd", "clamd", "freshclam","spamd",#mail |
25 |
+ "#".gettext("File-sharing services"),"smb","smbd","nmbd","ftp", |
26 |
+ "#".gettext("E-mail services"),"pop3","pop3s","dovecot","imaps","imap","qmail","qpsmtpd","sqpsmtpd", "clamd", "freshclam","spamd",#mail |
27 |
"#".gettext("DNS services"),"tinydns","dnscache", #dns |
28 |
- "#".gettext("Authentication services"),"oidentd","identd","ldap","smtp-auth-proxy","radiusd", #auth |
29 |
+ "#".gettext("Authentication services"),"oidentd","ldap","smtp-auth-proxy","radiusd", #auth |
30 |
"#".gettext("Misc. services"),"mysqld","ntpd","lpd", #misc |
31 |
"#".gettext("System services"),"crond","rsyslog","ulogd","acpid","raidmonitor"); #sys et materiel |
32 |
|
33 |
@@ -401,8 +401,9 @@ |
34 |
else |
35 |
{ |
36 |
#si c'est un service pour lequel on a des infos complementaires... |
37 |
- if($svc=~/^(httpd-e-smith|httpd-admin|smb|smbd|nmbd|atalk|squid|pptpd|dhcpd|sshd|proftpd|ftp|pppoe|pppd|wan|qmail|qpsmtpd|sqpsmtpd)$/) {$details=1;} |
38 |
- if ( -d "/service/$svc") {$cmd = "/usr/bin/sv s $svc";} # was -d /var/service or -d /service/ |
39 |
+ if($svc=~/^(httpd-e-smith|httpd-admin|smb|smbd|nmbd|squid|pptpd|dhcpd|sshd|ftp|pppoe|pppd|wan|qmail|qpsmtpd|sqpsmtpd)$/) {$details=1;} |
40 |
+ if ( -d "/service/$svc") {$cmd = "/usr/bin/sv s $svc";} # was -d /var/service or -d /service/ |
41 |
+ elsif ($svc=~/^(imaps|imap)$/) { $cmd = "/usr/bin/sv s dovecot"; } |
42 |
else {$cmd = "/sbin/e-smith/service $svc status|/bin/grep $svc";} |
43 |
my @res=`$cmd`; |
44 |
foreach (@res) |
45 |
@@ -423,8 +424,15 @@ |
46 |
#Warning !! Only on sme6 |
47 |
#proftpd est arrete |
48 |
|
49 |
+ if ($svc=~/^(imaps|imap)$/) |
50 |
+ { |
51 |
+ print $q->Tr((($details==1)? $q->td($q->a({href=>"$progname?state=service_detail&service=$svc"},"$svc")) : $q->td("$svc")), |
52 |
+ $q->td(""),$q->td( "dovecot" ) ,$q->td("$dbstatus"), $q->td( ( ("$dbstatus" ne "") ? (("$dbstatus" eq "enabled" )? $q->submit(-name=>"disabled_$svc",-value=>'disable'): $q->submit(-name=>"enabled_$svc",-value=>'enable')) : " ") ) ); |
53 |
+ |
54 |
+ |
55 |
+ } |
56 |
#si le service est arrete^:il ya down ou il n'y a pas de () pour le pid et ca ne fini pas par ... |
57 |
- if(/^down:/ || /^([a-zA-Z0-9]*) [^(^)]*([^.]{3})$/) |
58 |
+ elsif(/^down:/ || /^([a-zA-Z0-9]*) [^(^)]*([^.]{3})$/) |
59 |
{ |
60 |
#on fait une conditionnelle pour savoir si on met le nom du service en lien ou pas |
61 |
print $q->Tr((($details==1)? $q->td($q->a({href=>"$progname?state=service_detail&service=$svc"},"$svc")) : $q->td("$svc")), |
62 |
@@ -441,7 +449,7 @@ |
63 |
#sme6admind (pid 14320) en cours d'execution |
64 |
|
65 |
#si le service tourne |
66 |
- if (/^run:(.*)\(pid ([\d\s]+)\)/ || /^([a-zA-Z0-9]*) \(pid ([\d\s]+)\).*\.\.\.$/ ) |
67 |
+ elsif (/^run:(.*)\(pid ([\d\s]+)\)/ || /^([a-zA-Z0-9]*) \(pid ([\d\s]+)\).*\.\.\.$/ ) |
68 |
{ |
69 |
#$2=liste pids |
70 |
my @pids=split(/ /,$2); |