"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'] = "dhcrelay"; $pconfig['description'] = "DHCP Relay"; $services[] = $pconfig; unset($pconfig); } if(is_dhcp_server_enabled()) { $pconfig['name'] = "dhcpd"; $pconfig['description'] = "DHCP Service"; $services[] = $pconfig; unset($pconfig); } if(isset($config['snmpd']['enable'])) { $pconfig['name'] = "bsnmpd"; $pconfig['description'] = "SNMP Service"; $services[] = $pconfig; unset($pconfig); } if(isset($config['proxyarp']['proxyarpnet'])) { $pconfig['name'] = "choparp"; $pconfig['description'] = "Proxy Arp"; $services[] = $pconfig; unset($pconfig); } if($config['installedpackages']['miniupnpd']['config'][0]['enable']) { $pconfig['name'] = "miniupnpd"; $pconfig['description'] = gettext("UPnP Service"); $services[] = $pconfig; unset($pconfig); } if (isset($config['ipsec']['enable'])) { $pconfig['name'] = "racoon"; $pconfig['description'] = gettext("IPsec VPN"); $services[] = $pconfig; unset($pconfig); } foreach (array('server', 'client') as $mode) { if (is_array($config['installedpackages']["openvpn$mode"]['config'])) { foreach ($config['installedpackages']["openvpn$mode"]['config'] as $id => $settings) { $setting = $config['installedpackages']["openvpn$mode"]['config'][$id]; if (!$setting['disable']) { $pconfig['name'] = "openvpn"; $pconfig['mode'] = $mode; $pconfig['id'] = $id; $pconfig['description'] = "OpenVPN ".$mode.": ".htmlspecialchars($setting['description']); $services[] = $pconfig; unset($pconfig); } } } } if($services) { foreach($services as $service) { if(!$service['name']) continue; if(!$service['description']) $service['description'] = get_pkg_descr($service['name']); echo ''; echo ''; if ($service['name'] == "openvpn") { $running = (is_pid_running($g['varrun_path'] . "/openvpn_{$service['mode']}{$service['id']}.pid") ); } else { $running = (is_service_running($service['name'], $ps) or is_process_running($service['name']) ); } if($running) { echo '"; } else { echo '"; } echo ''; echo ''; } } else { echo ""; } ?>
Service
Description
Status
' . $service['name'] . '' . $service['description'] . '
'; echo " Running
'; echo " Stopped
'; if($running) { if ($service['name'] == "openvpn") { echo ""; } else { echo ""; } echo " "; if ($service['name'] == "openvpn") { echo ""; } else { echo " "; } echo " "; echo ""; } else { if ($service['name'] == "openvpn") { echo ""; } else { echo " "; } echo " "; } echo '
No services found.