Project

General

Profile

« Previous | Next » 

Revision 25d3fbd5

Added by Scott Ullrich about 20 years ago

  • Add ascii art from holger
  • Add base services to status -> services menu

View differences:

usr/local/www/status_services.php
86 86
	$ps[] = trim(array_pop(explode(' ', array_pop(explode('/', $line)))));
87 87
}
88 88

  
89
if($config['installedpackages']['service']) {
90
	foreach($config['installedpackages']['service'] as $service) {
89
$services = &$config['installedpackages']['service'];
90

  
91
/*    Add services that are in the base.
92
 *
93
 */
94
if(isset($config['dnsmasq']['enable'])) {
95
	$pconfig['name'] = "dnsmasq";
96
	$pconfig['description'] = "DNS Forwarder";
97
	$services[] = $pconfig;
98
}
99

  
100
if(isset($config['captiveportal']['enable'])) {
101
	$pconfig['name'] = "mini_httpd";
102
	$pconfig['description'] = "Captive Portal";
103
	$services[] = $pconfig;
104
}
105

  
106
if(isset($config['dnsmasq']['enable'])) {
107
	$pconfig['name'] = "dnsmasq";
108
	$pconfig['description'] = "DHCP Relay";
109
	$services[] = $pconfig;
110
}
111

  
112
if(isset($config['dhcpd']['enable'])) {
113
	$pconfig['name'] = "dhcpd";
114
	$pconfig['description'] = "DHCP Server";
115
	$services[] = $pconfig;
116
}
117

  
118
if(isset($config['snmpd']['enable'])) {
119
	$pconfig['name'] = "bsnmpd";
120
	$pconfig['description'] = "SNMP";
121
	$services[] = $pconfig;
122
}
123

  
124
if(isset($config['wol']['wolentry'])) {
125
	$pconfig['name'] = "wol";
126
	$pconfig['description'] = "Wake on lan";
127
	$services[] = $pconfig;
128
}
129

  
130
if(isset($config['proxyarp']['proxyarpnet'])) {
131
	$pconfig['name'] = "proxyarp";
132
	$pconfig['description'] = "Proxy Arp";
133
	$services[] = $pconfig;
134
}
135

  
136
if($services) {
137
	foreach($services as $service) {
91 138
		if(!$service['name']) continue;
92 139
		if(!$service['description']) $service['description'] = "Unknown";
93 140
		echo '<tr><td class="listlr">' . $service['name'] . '</td>';
94 141
		echo '<td class="listlr">' . $service['description'] . '</td>';
95
		if(is_service_running($service['name'], $ps)) {
96
			echo '<td class="listlr">Running</td>';
142
		if(is_service_running($service['name'], $ps) or is_process_running($service['name']) ) {
143
			echo '<td class="listbg"><font color="white">Running</td><td><img src="/themes/{$g["theme"]/images/icons/icon_pass.gif"></td>';
97 144
			$running = true;
98 145
		} else {
99
			echo '<td class="listbg">Stopped</td>';
146
			echo '<td class="listbg"><font color="white">Stopped</td><td><img src="/themes/{$g["theme"]/images/icons/icon_block.gif"></td>';
100 147
			$running = false;
101 148
		}
102 149
		echo '<td valign="middle" class="list" nowrap>';

Also available in: Unified diff