Monit template should always create config even with disabled service

This commit is contained in:
Frank Brendel
2017-03-09 08:23:01 +01:00
committed by Franco Fichtner
parent 3f1428dee4
commit 371b6e4693
2 changed files with 6 additions and 2 deletions
@@ -355,7 +355,11 @@ class SettingsController extends ApiControllerBase
if ($valMsgs->count() == 0) {
$mdlMonit->serializeToConfig();
Config::getInstance()->save();
$result["result"] = "saved";
$svcMonit = new ServiceController();
$result = $svcMonit->configtestAction();
if ($nodeType == 'general' && $node->enabled->__toString() == 0) {
$result['stop'] = $svcMonit->stopAction();
}
}
}
}
@@ -1,7 +1,7 @@
# DO NOT EDIT THIS FILE -- OPNsense auto-generated file
{% from 'OPNsense/Macros/interface.macro' import physical_interface %}
{% if helpers.exists('OPNsense.monit.general.enabled') and OPNsense.monit.general.enabled|default("0") == "1" %}
{% if helpers.exists('OPNsense.monit.general') %}
set httpd unixsocket /var/run/monit.sock
allow localhost