sysutils/nut: add missing templating and fix for privilege usage (#966)

(cherry picked from commit 2e553f844b)
This commit is contained in:
Michael 2018-11-10 14:20:15 +01:00 committed by Franco Fichtner
parent 983448ea65
commit 786043839f
3 changed files with 17 additions and 2 deletions

View file

@ -1,6 +1,6 @@
PLUGIN_NAME= nut
PLUGIN_VERSION= 1.3
PLUGIN_REVISION= 1
PLUGIN_REVISION= 2
PLUGIN_COMMENT= Network UPS Tools
PLUGIN_DEPENDS= nut
PLUGIN_MAINTAINER= m.muenz@gmail.com

View file

@ -16,7 +16,7 @@
<netclient>netclient</netclient>
</OptionValues>
</mode>
<name type="TextField">
<name type="TextField">
<default>UPSName</default>
<Required>Y</Required>
</name>

View file

@ -11,3 +11,18 @@ MONITOR {{ OPNsense.Nut.general.name }}@{{ OPNsense.Nut.netclient.address }} 1 {
SHUTDOWNCMD "/usr/local/etc/rc.halt"
POWERDOWNFLAG /etc/killpower
{% endif %}
{% if helpers.exists('OPNsense.Nut.apcsmart.enable') and OPNsense.Nut.apcsmart.enable == '1' %}
MONITOR {{ OPNsense.Nut.general.name }} 1 monuser {{ OPNsense.Nut.account.mon_password }} master
SHUTDOWNCMD "/usr/local/etc/rc.halt"
POWERDOWNFLAG /etc/killpower
{% endif %}
{% if helpers.exists('OPNsense.Nut.blazerusb.enable') and OPNsense.Nut.blazerusb.enable == '1' %}
MONITOR {{ OPNsense.Nut.general.name }} 1 monuser {{ OPNsense.Nut.account.mon_password }} master
SHUTDOWNCMD "/usr/local/etc/rc.halt"
POWERDOWNFLAG /etc/killpower
{% endif %}
{% if helpers.exists('OPNsense.Nut.blazerser.enable') and OPNsense.Nut.blazerser.enable == '1' %}
MONITOR {{ OPNsense.Nut.general.name }} 1 monuser {{ OPNsense.Nut.account.mon_password }} master
SHUTDOWNCMD "/usr/local/etc/rc.halt"
POWERDOWNFLAG /etc/killpower
{% endif %}