From 18a17e3074855d8e14c4c0fdf26c8f533175fcb4 Mon Sep 17 00:00:00 2001 From: SunStroke74 Date: Thu, 13 Nov 2014 23:57:26 +0500 Subject: Advansed options for NUT config files Allow add custom options in NUT config files. Raw text, no syntax checking. --- config/nut/nut.xml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'config/nut') diff --git a/config/nut/nut.xml b/config/nut/nut.xml index 210d7b82..d1496a16 100644 --- a/config/nut/nut.xml +++ b/config/nut/nut.xml @@ -84,6 +84,7 @@ 0755 https://packages.pfsense.org/packages/config/nut/status_nut.php + enabled General Settings @@ -118,6 +119,42 @@ powerdown checkbox + + ups.conf options + custom_upsconf + Write there any custom options for ups.conf. All options must be separated by semi-colons (;). + textarea + 65 + 5 + + + + upsd.conf options + custom_upsdconf + Write there any custom options for upsd.conf. All options must be separated by semi-colons (;). + textarea + 65 + 5 + + + + upsd.users options + custom_upsdusers + Write there any custom options for upsd.users. All options must be separated by semi-colons (;). + textarea + 65 + 5 + + + + upsmon.conf options + custom_upsmonconf + Write there any custom options for upsmon.conf. All options must be separated by semi-colons (;). + textarea + 65 + 5 + + Remote Access Settings - Used for Local and SNMP Types to allow access listtopic -- cgit v1.2.3 From 5dad2a3d4ad07cdf28ab32a5429173d335894916 Mon Sep 17 00:00:00 2001 From: SunStroke74 Date: Fri, 14 Nov 2014 00:05:36 +0500 Subject: Advansed options for NUT config files Allow add custom options in NUT config files. Raw text, no syntax checking. --- config/nut/nut.inc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'config/nut') diff --git a/config/nut/nut.inc b/config/nut/nut.inc index 11fb4b26..2dfe944b 100644 --- a/config/nut/nut.inc +++ b/config/nut/nut.inc @@ -184,6 +184,7 @@ $remoteuser = nut_config('remoteuser'); $remotepass = nut_config('remotepass'); $shutdownflag = (nut_config('powerdown') == 'on') ? '-p' : '-h'; + $custom_upsmonconf = str_replace(";", "\n", nut_config('custom_upsmonconf')); if(!($remotename && $remoteaddr && $remoteuser && $remotepass)) return false; @@ -194,6 +195,7 @@ MONITOR {$remotename}@{$remoteaddr} 1 {$remoteuser} {$remotepass} slave MINSUPPLIES 1 SHUTDOWNCMD "/sbin/shutdown {$shutdownflag} +0" POWERDOWNFLAG /etc/killpower +{$custom_upsmonconf} EOD; $stop = <<