Re: [Apcupsd-users] Proposed change to apccontrol.bat
Brought to you by:
adk0212
|
From: Adam K. <akr...@ro...> - 2011-07-08 03:37:31
|
On Tue, Jun 14, 2011 at 8:33 AM, Automate . <ji...@gm...> wrote: > I would like to have my own program triggered by every possible event but I > would rather not create and maintain 19 different programs but rather pass > the event type as a parameter to the program. I propose the user setting an > environment variable apcupsdoneprog (apcups uses one program) to tell the > batch file to run a single program instead of individual programs See > proposed logic below. I don't really like this approach too much. Using environment variables to affect program behavior tends to be obscure and error-prone. I'd prefer apccontrol always attempt to call an override script (maybe "apccontrol.override" or "apccontrol.pre") and terminate or continue when that script completes based on the return code just like protocol for the individual event scripts. --Adam |