[Nut-upsdev] Patch: upssched puts UPS name in the command line

Kiss Gabor (Bitman) kissg at ssg.ki.iif.hu
Mon Jun 7 13:41:28 UTC 2010


Dear folks,

The patch in attachment allows upssched to put actual UPS name
into command line even if configuration contains wildcard (*).
E.g.

AT LOWBATT *    EXECUTE "LOWBATT %s"
AT ONLINE  ups3 EXECUTE "ONLINE %s"

where %s is replaced with UPS name before logging and execution.

A possible further enhancement could be if regular expressions
are also acceptable in place of asterisk. I mean something
like this:

AT FSD ups1         EXECUTE "shutting down %s"
AT FSD *            EXECUTE "shutting down %s"
AT FSD /^ups[2-4]$/ EXECUTE "blowing up %s :-)"

However I know tee few automake, GNU config and various
regexp implementations.
I'm afraid I could not add this feature in a platform
independent way.

Regards

Gabor



More information about the Nut-upsdev mailing list