nut/scripts/augeas/nutupsconf.aug.tpl

64 lines
1.7 KiB
Smarty
Raw Normal View History

2011-01-26 09:35:08 +00:00
(*
Module: NutUpsConf
Parses @CONFPATH@/ups.conf
Author: Raphael Pinson <raphink@gmail.com>
Frederic Bohe <fredericbohe@eaton.com>
Arnaud Quette <arnaud.quette@gmail.com>
About: License
This file is licensed under the GPL.
About: Lens Usage
Sample usage of this lens in augtool
* Print all drivers used
> print /files/@CONFPATH@/ups.conf/*/driver
About: Configuration files
This lens applies to @CONFPATH@/ups.conf. See <filter>.
*)
module NutUpsConf =
autoload ups_xfm
(************************************************************************
* Group: UPS.CONF
*************************************************************************)
let ups_comment = IniFile.comment IniFile.comment_re IniFile.comment_default
let ups_sep = IniFile.sep IniFile.sep_re IniFile.sep_default
let ups_global = "chroot"
| "driverpath"
| "maxstartdelay"
2016-07-18 00:11:41 +00:00
| "maxretry"
| "retrydelay"
2011-01-26 09:35:08 +00:00
| "pollinterval"
2016-07-18 00:11:41 +00:00
| "synchronous"
2011-01-26 09:35:08 +00:00
| "user"
let ups_fields = "driver"
| "port"
| "sdorder"
| "desc"
| "nolock"
2016-07-18 00:11:41 +00:00
| "ignorelb"
2011-01-26 09:35:08 +00:00
| "maxstartdelay"
2016-07-18 00:11:41 +00:00
| "synchronous"
2011-01-26 09:35:08 +00:00
@SPECIFIC_DRV_VARS@
let ups_entry = IniFile.indented_entry (ups_global|ups_fields) ups_sep ups_comment
let ups_title = IniFile.indented_title IniFile.record_re
let ups_record = IniFile.record ups_title ups_entry
let ups_lns = IniFile.lns ups_record ups_comment
let ups_filter = (incl "@CONFPATH@/ups.conf")
. Util.stdexcl
let ups_xfm = transform ups_lns ups_filter