#!/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 "
\n";
print "
\n";
print " $text{'titidx_ldaprestart'} |
\n";
print " \n";
$str=$config{'ldap_restart'};
$exec_str="ldap";
$cmd_str="restart";
if (&run_cmd($str)) {
# print "-- oOo -- | \n";
} else {
print "$text{'index_cmderr'} | \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>/g;
$srv_status =~ s/STTA://g;
print " $srv_status | \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> | /g;
$srv_status =~ s/STTA://g;
print " $srv_status | \n";
# if (&run_cmd($str)) {
# # print "-- oOo -- | \n";
# } else {
# print "$text{'index_cmderr'} | \n";
# }
# print "".&text('viewlog_action',$stta_sid)." | ";
}
&scanSTTA_services("all");
print "\n";
print " \n";
print " | |
\n";
&footer($text{'back_return'},$text{'index'});
do "footer.pl";
exit;