From b8e422b56cc5b4e60f5eccf5197841646da58658 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 6 Feb 2020 22:58:51 +0100 Subject: [PATCH] sysutils/nut: Add PowerWare bcmxcp_usb driver (#1658) --- sysutils/nut/Makefile | 3 +-- sysutils/nut/pkg-descr | 4 ++++ .../controllers/OPNsense/Nut/forms/settings.xml | 16 ++++++++++++++++ .../opnsense/mvc/app/models/OPNsense/Nut/Nut.xml | 10 ++++++++++ .../service/templates/OPNsense/Nut/ups.conf | 9 +++++++++ .../service/templates/OPNsense/Nut/upsmon.conf | 5 +++++ 6 files changed, 45 insertions(+), 2 deletions(-) diff --git a/sysutils/nut/Makefile b/sysutils/nut/Makefile index eff06a127..2262b7e18 100644 --- a/sysutils/nut/Makefile +++ b/sysutils/nut/Makefile @@ -1,6 +1,5 @@ PLUGIN_NAME= nut -PLUGIN_VERSION= 1.6 -PLUGIN_REVISION= 2 +PLUGIN_VERSION= 1.7 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 b197d02b2..2a4925c4d 100644 --- a/sysutils/nut/pkg-descr +++ b/sysutils/nut/pkg-descr @@ -9,6 +9,10 @@ and management interface. Plugin Changelog ---------------- +1.7 + +* Add PowerWare bcmxcp_usb driver + 1.6 * Add QX driver support 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 1aa412dac..d581b2c17 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,22 @@ Set extra arguments for this UPS, e.g. "port=auto". + + + nut.bcmxcpusb.enable + + checkbox + Enable the PowerWare BCMXCPUSB driver. + + + nut.bcmxcpusb.args + + + select_multiple + true + Set extra arguments for this UPS, e.g. "port=auto". + + nut.blazerusb.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 e9bdf73de..d8247f37c 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 @@ -59,6 +59,16 @@ N + + + Y + 0 + + + port=auto + 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 a274e9432..6204f6d25 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.bcmxcpusb.enable') and OPNsense.Nut.bcmxcpusb.enable == '1' %} +[{{ OPNsense.Nut.general.name }}] +driver=bcmxcp_usb +{% if helpers.exists('OPNsense.Nut.bcmxcpusb.args') and OPNsense.Nut.bcmxcpusb.args != '' %} +{% for args in OPNsense.Nut.bcmxcpusb.args.split(',') %} +{{ args }} +{% endfor %} +{% endif %} +{% endif %} {% if helpers.exists('OPNsense.Nut.blazerusb.enable') and OPNsense.Nut.blazerusb.enable == '1' %} [{{ OPNsense.Nut.general.name }}] driver=blazer_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 8878b83b8..334bc91a9 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.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" +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"