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') 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 = <<