Service |
Description |
Status |
"LAN");
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
$oc = $config['interfaces']['opt' . $i];
if (isset($oc['enable']) && $oc['if'] && (!$oc['bridge']))
$iflist['opt' . $i] = "opt{$i}";
}
$show_dhcprelay = false;
foreach($iflist as $if) {
if(isset($config['dhcrelay'][$if]['enable']))
$show_dhcprelay = true;
}
if($show_dhcprelay == true) {
$pconfig['name'] = "dhcprelay";
$pconfig['description'] = "DHCP Relay";
$services[] = $pconfig;
unset($pconfig);
}
if(is_dhcp_server_enabled()) {
$pconfig['name'] = "dhcpd";
$pconfig['description'] = "DHCP Server";
$services[] = $pconfig;
unset($pconfig);
}
if(isset($config['snmpd']['enable'])) {
$pconfig['name'] = "bsnmpd";
$pconfig['description'] = "SNMP";
$services[] = $pconfig;
unset($pconfig);
}
if(isset($config['proxyarp']['proxyarpnet'])) {
$pconfig['name'] = "choparp";
$pconfig['description'] = "Proxy Arp";
$services[] = $pconfig;
unset($pconfig);
}
if($services) {
foreach($services as $service) {
if(!$service['name']) continue;
if(!$service['description']) $service['description'] = "Unknown";
echo '' . $service['name'] . ' | ';
echo '' . $service['description'] . ' | ';
if(is_service_running($service['name'], $ps) or is_process_running($service['name']) ) {
echo '';
echo " Running | ";
$running = true;
} else {
echo '';
echo " Stopped | ";
$running = false;
}
echo '';
if($running) {
echo "";
echo " ";
echo "";
echo " ";
echo "";
} else {
echo " ";
echo " ";
}
echo ' | ';
echo ' ';
}
} else {
echo "No services found. | ";
}
?>
|