mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 03:16:12 +00:00
plugins: everything should be plugins...
Since plugins are now tied to the heartbeat of the system itself, it makes sense to split out hardcoded base functionality into their pluggable counterparts. Start with the candidates that already have a plugin file. Discussed with: @adschellevis
This commit is contained in:
parent
67aeec79be
commit
6d2c81d74b
@ -28,8 +28,30 @@
|
||||
function miniupnpd_firewall($fw)
|
||||
{
|
||||
global $config;
|
||||
|
||||
if (isset($config['installedpackages']['miniupnpd']['config'][0]['enable'])) {
|
||||
$fw->registerAnchor("miniupnpd/*", "rdr");
|
||||
$fw->registerAnchor("miniupnpd/*", "fw");
|
||||
}
|
||||
}
|
||||
|
||||
function miniupnpd_services()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$services = array();
|
||||
|
||||
if (isset($config['installedpackages']['miniupnpd']['config'][0]['enable'])) {
|
||||
$pconfig = array();
|
||||
$pconfig['name'] = "miniupnpd";
|
||||
$pconfig['description'] = gettext("UPnP Service");
|
||||
$pconfig['description'] = gettext("UPnP Service");
|
||||
$pconfig['php']['restart'] = array('upnp_stop', 'upnp_start');
|
||||
$pconfig['php']['start'] = array('upnp_start');
|
||||
$pconfig['php']['stop'] = array('upnp_stop');
|
||||
$pconfig['pidfile'] = '/var/run/miniupnpd.pid';
|
||||
$services[] = $pconfig;
|
||||
}
|
||||
|
||||
return $services;
|
||||
}
|
||||
|
||||
@ -26,6 +26,26 @@
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
function squid_services()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$services = array();
|
||||
|
||||
if (isset($config['OPNsense']['proxy']['general']['enabled']) && $config['OPNsense']['proxy']['general']['enabled'] == 1) {
|
||||
$services[] = array(
|
||||
'description' => gettext('Proxy server'),
|
||||
'configd' => array(
|
||||
'restart' => array('proxy restart'),
|
||||
'start' => array('proxy start'),
|
||||
'stop' => array('proxy stop'),
|
||||
),
|
||||
'name' => 'squid',
|
||||
);
|
||||
}
|
||||
|
||||
return $services;
|
||||
}
|
||||
|
||||
function squid_syslog()
|
||||
{
|
||||
|
||||
@ -26,6 +26,26 @@
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
function suricata_services()
|
||||
{
|
||||
global $config;
|
||||
|
||||
$services = array();
|
||||
|
||||
if (isset($config['OPNsense']['IDS']['general']['enabled']) && $config['OPNsense']['IDS']['general']['enabled'] == 1) {
|
||||
$services[] = array(
|
||||
'description' => gettext('Intrusion Detection'),
|
||||
'configd' => array(
|
||||
'restart' => array('ids restart'),
|
||||
'start' => array('ids start'),
|
||||
'stop' => array('ids stop'),
|
||||
),
|
||||
'name' => 'suricata',
|
||||
);
|
||||
}
|
||||
|
||||
return $services;
|
||||
}
|
||||
|
||||
function suricata_syslog()
|
||||
{
|
||||
|
||||
@ -2494,18 +2494,6 @@ function services_get()
|
||||
$services[] = $pconfig;
|
||||
}
|
||||
|
||||
if (isset($config['installedpackages']['miniupnpd']) && $config['installedpackages']['miniupnpd']['config'][0]['enable']) {
|
||||
$pconfig = array();
|
||||
$pconfig['name'] = "miniupnpd";
|
||||
$pconfig['description'] = gettext("UPnP Service");
|
||||
$pconfig['description'] = gettext("UPnP Service");
|
||||
$pconfig['php']['restart'] = array('upnp_stop', 'upnp_start');
|
||||
$pconfig['php']['start'] = array('upnp_start');
|
||||
$pconfig['php']['stop'] = array('upnp_stop');
|
||||
$pconfig['pidfile'] = '/var/run/miniupnpd.pid';
|
||||
$services[] = $pconfig;
|
||||
}
|
||||
|
||||
if (isset($config['system']['ssh']['enabled'])) {
|
||||
$pconfig = array();
|
||||
$pconfig['name'] = 'sshd';
|
||||
@ -2524,30 +2512,6 @@ function services_get()
|
||||
$services[] = $pconfig;
|
||||
}
|
||||
|
||||
if (isset($config['OPNsense']['proxy']['general']['enabled']) && $config['OPNsense']['proxy']['general']['enabled'] == 1) {
|
||||
$services[] = array(
|
||||
'description' => gettext('Proxy server'),
|
||||
'configd' => array(
|
||||
'restart' => array('proxy restart'),
|
||||
'start' => array('proxy start'),
|
||||
'stop' => array('proxy stop'),
|
||||
),
|
||||
'name' => 'squid',
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($config['OPNsense']['IDS']['general']['enabled']) && $config['OPNsense']['IDS']['general']['enabled'] == 1) {
|
||||
$services[] = array(
|
||||
'description' => gettext('Intrusion Detection'),
|
||||
'configd' => array(
|
||||
'restart' => array('ids restart'),
|
||||
'start' => array('ids start'),
|
||||
'stop' => array('ids stop'),
|
||||
),
|
||||
'name' => 'suricata',
|
||||
);
|
||||
}
|
||||
|
||||
if (isset($config['OPNsense']['captiveportal']['zones']['zone'])) {
|
||||
$enabled = false;
|
||||
if (!empty($config['OPNsense']['captiveportal']['zones']['zone']['enabled'])) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user