diff --git a/sysutils/nut/Makefile b/sysutils/nut/Makefile index bddbdb5d3..0c7ccd2df 100644 --- a/sysutils/nut/Makefile +++ b/sysutils/nut/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= nut -PLUGIN_VERSION= 1.4 +PLUGIN_VERSION= 1.5 PLUGIN_COMMENT= Network UPS Tools PLUGIN_DEPENDS= nut PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml b/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml index f14e69270..b5f05913c 100644 --- a/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml +++ b/sysutils/nut/src/opnsense/mvc/app/controllers/OPNsense/Nut/forms/settings.xml @@ -134,6 +134,22 @@ Set the password of the remote NUT server. + + + nut.riello.enable + + checkbox + Enable the Riello driver. + + + nut.riello.args + + + select_multiple + true + Set extra arguments for this UPS, e.g. "port=auto". + + nut-general-settings diff --git a/sysutils/nut/src/opnsense/mvc/app/models/OPNsense/Nut/Nut.xml b/sysutils/nut/src/opnsense/mvc/app/models/OPNsense/Nut/Nut.xml index a5f2c4503..2215c0209 100644 --- a/sysutils/nut/src/opnsense/mvc/app/models/OPNsense/Nut/Nut.xml +++ b/sysutils/nut/src/opnsense/mvc/app/models/OPNsense/Nut/Nut.xml @@ -93,5 +93,15 @@ N + + + Y + 0 + + + port=auto + N + + diff --git a/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/ups.conf b/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/ups.conf index c7312c568..7f50fbf71 100644 --- a/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/ups.conf +++ b/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/ups.conf @@ -38,4 +38,13 @@ driver=blazer_ser {% endfor %} {% endif %} {% endif %} +{% if helpers.exists('OPNsense.Nut.riello.enable') and OPNsense.Nut.riello.enable == '1' %} +[{{ OPNsense.Nut.general.name }}] +driver=riello_usb +{% if helpers.exists('OPNsense.Nut.riello.args') and OPNsense.Nut.riello.args != '' %} +{% for args in OPNsense.Nut.riello.args.split(',') %} +{{ args }} +{% endfor %} +{% endif %} +{% endif %} {% endif %} diff --git a/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf b/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf index f33968a9f..fa1cd02d8 100644 --- a/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf +++ b/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf @@ -26,3 +26,8 @@ MONITOR {{ OPNsense.Nut.general.name }} 1 monuser {{ OPNsense.Nut.account.mon_pa SHUTDOWNCMD "/usr/local/etc/rc.halt" POWERDOWNFLAG /etc/killpower {% endif %} +{% if helpers.exists('OPNsense.Nut.riello.enable') and OPNsense.Nut.riello.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 %}