mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/zerotier: Prevent invalid 'local.conf' on initial save.
There is potential for an invalid local.conf to be written out during first
save. Whilst it doesn't stop Zerotier from starting, it does cause it to
return a 1 as an error code, thus fooling configd that the service has failed
to start. Adding in a default '{}' resolves this issue.
-=david=-
This commit is contained in:
committed by
Franco Fichtner
parent
b384ce560f
commit
14c1b3b447
+3
@@ -48,6 +48,9 @@ class SettingsController extends ApiMutableModelControllerBase
|
||||
$result = array();
|
||||
if ($this->request->isGet()) {
|
||||
$mdlZerotier = $this->getModel();
|
||||
if(empty($mdlZerotier->localconf->__toString())) {
|
||||
$mdlZerotier->localconf = '{}';
|
||||
}
|
||||
$result = array("zerotier" => $mdlZerotier->getNodes());
|
||||
}
|
||||
return $result;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
{% if helpers.exists('OPNsense.zerotier.localconf') and OPNsense.zerotier.localconf|default("") != "" %}
|
||||
{{ OPNsense.zerotier.localconf }}
|
||||
{% else %}
|
||||
{}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user