diff --git a/sysutils/nut/Makefile b/sysutils/nut/Makefile index 52fe1c9c9..caf7bfcc9 100644 --- a/sysutils/nut/Makefile +++ b/sysutils/nut/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= nut -PLUGIN_VERSION= 1.7 -PLUGIN_REVISION= 1 +PLUGIN_VERSION= 1.8 PLUGIN_COMMENT= Network UPS Tools PLUGIN_DEPENDS= nut PLUGIN_MAINTAINER= m.muenz@gmail.com diff --git a/sysutils/nut/pkg-descr b/sysutils/nut/pkg-descr index 2a4925c4d..9f9fe6b37 100644 --- a/sysutils/nut/pkg-descr +++ b/sysutils/nut/pkg-descr @@ -9,6 +9,10 @@ and management interface. Plugin Changelog ---------------- +1.8 + +* Add apcupsd-ups driver support + 1.7 * Add PowerWare bcmxcp_usb driver 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 444cb42a5..919cb5646 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 @@ -76,6 +76,26 @@ Set extra arguments for this UPS, e.g. "port=auto". + + + nut.apcupsd.enable + + checkbox + Enable the APCUPSD controlled devices driver. + + + nut.apcupsd.hostname + + text + Set the hostname or ip of the remote apcupsd server. + + + nut.apcupsd.port + + text + Set the port of the remote apcupsd server (optional). + + nut.bcmxcpusb.enable 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 d8247f37c..3a200bd11 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 @@ -1,7 +1,7 @@ //OPNsense/Nut Network UPS Tools - 1.0.3 + 1.0.4 @@ -59,6 +59,19 @@ N + + + Y + 0 + + + Y + localhost + + + N + + Y 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 6204f6d25..846345cf7 100644 --- a/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/ups.conf +++ b/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/ups.conf @@ -20,6 +20,15 @@ driver=apcsmart {% endfor %} {% endif %} {% endif %} +{% if helpers.exists('OPNsense.Nut.apcupsd.enable') and OPNsense.Nut.apcupsd.enable == '1' %} +[{{ OPNsense.Nut.general.name }}] +driver=apcupsd-ups +{% if helpers.exists('OPNsense.Nut.apcupsd.port') and OPNsense.Nut.apcupsd.port != '' %} +port={{ OPNsense.Nut.apcupsd.hostname }}:{{ OPNsense.Nut.apcupsd.port }} +{% else %} +port={{ OPNsense.Nut.apcupsd.hostname }} +{% endif %} +{% endif %} {% if helpers.exists('OPNsense.Nut.bcmxcpusb.enable') and OPNsense.Nut.bcmxcpusb.enable == '1' %} [{{ OPNsense.Nut.general.name }}] driver=bcmxcp_usb 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 334bc91a9..e37c42477 100644 --- a/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf +++ b/sysutils/nut/src/opnsense/service/templates/OPNsense/Nut/upsmon.conf @@ -16,6 +16,11 @@ 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.apcupsd.enable') and OPNsense.Nut.apcupsd.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.bcmxcpusb.enable') and OPNsense.Nut.bcmxcpusb.enable == '1' %} MONITOR {{ OPNsense.Nut.general.name }} 1 monuser {{ OPNsense.Nut.account.mon_password }} master SHUTDOWNCMD "/usr/local/etc/rc.halt"