stta/stta/ldap_restart.cgi
2021-10-01 20:35:43 +01:00

69 lines
2.7 KiB
Perl
Executable File

#!/usr/bin/perl
# ldap_restart.cgi
# LDAP Services Restart
# STTA Rev. 1.3 Copyright (c) 2001-2004 Jesús Pérez Lorenzo --- license GNU GPL
# stta: (@#) 1.31051043346- [2004_01_29_102036]
require './stta-lib.pl';
&foreign_require("proc", "proc-lib.pl");
$config{iferror_services}="warn";
&headerstta($text{'index_ldaprestart'}, "", "ldaprestart",undef,1,0,"$text{'headpage_right'}"."$text{'head_logout'}",undef,undef,"$text{head_below}" );
print "<hr><p>\n";
print "<table width=100% border>\n";
print "<tr $tb> <td><font color='$revtext'><b>$text{'titidx_ldaprestart'}</b></td> </tr>\n";
print "<tr $cb> <td><table width=100%>\n";
$str=$config{'ldap_restart'};
$exec_str="ldap";
$cmd_str="restart";
if (&run_cmd($str)) {
# print "<tr><td><center><b>-- oOo --</b></center></td></tr>\n";
} else {
print "<tr><td><b>$text{'index_cmderr'}</b></td></tr>\n";
}
$str=$config{'ldap_restart'};
$host=$config{ldap_server};
$thishost_name=$config{ldap_servertitle};
$title="$text{srvLDAP} $thishost_name:";
$srv_status="";
if ( $host ) {
$port=$config {ldap_port};
&chkout_service("status",$title,$sttaparams{'ldap'}{'ldap_status'},\$srv_status);
} else {
&chkout_service("status",$title,"unknown",\$srv_status);
};
$srv_status =~ s/==/<\/td><td><b>/g;
$srv_status =~ s/STTA://g;
print "<tr><td><center><b> $srv_status </b></center></td></tr>\n";
if ( $config{ldap2_server}.length gt 0 ) {
$str=$config{'ldap2_restart'};
$host=$config{ldap2_server};
$thishost_name=$config{ldap2_servertitle};
$title="$text{srvLDAP} $thishost_name:";
$srv_status="";
if ( $host ) {
$port=$config {ldap2_port};
&chkout_service("status",$title,$sttaparams{'ldap'}{'ldap2_status'},\$srv_status);
} else {
&chkout_service("status",$title,"unknown",\$srv_status);
};
$srv_status =~ s/==/<\/td><td><b>/g;
$srv_status =~ s/STTA://g;
print "<tr><td><center><b> $srv_status </b></center></td></tr>\n";
# if (&run_cmd($str)) {
# # print "<tr><td><center><b>-- oOo --</b></center></td></tr>\n";
# } else {
# print "<tr><td><b>$text{'index_cmderr'}</b></td></tr>\n";
# }
# print "<tr><td><center>".&text('viewlog_action',$stta_sid)."</td></tr>";
}
&scanSTTA_services("all");
print "<tr>\n";
print "<tr>\n";
print "</table></table><p>\n";
&footer($text{'back_return'},$text{'index'});
do "footer.pl";
exit;