Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion opnsense/src/etc/inc/plugins.inc.d/defguardgateway.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ function defguardgateway_services()
{
$services = [];

$pidfile = (string) (new OPNsense\DefguardGateway\DefguardGateway())->general->PidFile;

$services[] = [
"description" => "Defguard Gateway",
"configd" => [
"start" => ["defguard_gateway start"],
"restart" => ["defguard_gateway restart"],
"stop" => ["defguard_gateway stop"],
],
"pidfile" => empty($pidfile) ? "/var/run/defguard_gateway.pid" : $pidfile,
"name" => "defguard_gateway",
"nocheck" => true,
];

return $services;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
<id>defguardgateway.general.PidFile</id>
<label>PID file</label>
<type>text</type>
<hint>Save PID to this file.</hint>
<help>Optional: write PID to this file.</help>
<hint>Default value: /var/run/defguard_gateway.pid</hint>
</field>
<field>
<id>defguardgateway.general.SyslogSocket</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<Required>Y</Required>
</UseSyslog>
<PidFile type="TextField">
<default>/var/run/defguard_gateway.pid</default>
<Required>N</Required>
</PidFile>
<SyslogSocket type="TextField">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ stats_period = {{ OPNsense.defguardgateway.general.StatsPeriod|default(60) }}
# Required: name of WireGuard interface
ifname = "{{ OPNsense.defguardgateway.general.IfName|default("wg0") }}"
# Optional: write PID to this file
{% if not helpers.empty('OPNsense.defguardgateway.general.PidFile') %}
pidfile = "{{ OPNsense.defguardgateway.general.PidFile }}"
{% endif %}
pidfile = "{{ OPNsense.defguardgateway.general.PidFile|default("/var/run/defguard_gateway.pid") }}"
# Required: enable logging to syslog
{% if OPNsense.defguardgateway.general.UseSyslog == "1" %}
use_syslog = true
Expand Down