Imported Upstream version 2.6.0
This commit is contained in:
parent
26fb71b504
commit
459aaf9392
510 changed files with 40508 additions and 18859 deletions
45
scripts/augeas/nuthostsconf.aug.in
Normal file
45
scripts/augeas/nuthostsconf.aug.in
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
(*
|
||||
Module: NutHostsConf
|
||||
Parses @CONFPATH@/hosts.conf
|
||||
|
||||
Author: Frederic Bohe <fredericbohe@eaton.com>
|
||||
|
||||
About: License
|
||||
This file is licensed under the GPL.
|
||||
|
||||
About: Lens Usage
|
||||
Sample usage of this lens in augtool
|
||||
|
||||
* Print all monitored upsd
|
||||
> print /files@CONFPATH@/hosts.conf/MONITOR
|
||||
|
||||
About: Configuration files
|
||||
This lens applies to @CONFPATH@/hosts.conf. See <filter>.
|
||||
*)
|
||||
|
||||
module NutHostsConf =
|
||||
autoload hosts_xfm
|
||||
|
||||
(************************************************************************
|
||||
* Group: HOSTS.CONF
|
||||
*************************************************************************)
|
||||
|
||||
(* general *)
|
||||
let del_spc = Util.del_opt_ws ""
|
||||
let sep_spc = Util.del_ws_spc
|
||||
let eol = Util.eol
|
||||
let word = /[^"#; \t\n]+/
|
||||
let empty = Util.empty
|
||||
let comment = Util.comment
|
||||
let quoted_string = del "\"" "\"" . store /[^"\n]+/ . del "\"" "\""
|
||||
|
||||
let hosts_notify = [ del_spc . key "MONITOR" . sep_spc
|
||||
. [ label "system" . store word . sep_spc ]
|
||||
. [ label "description" . quoted_string ] . eol ]
|
||||
|
||||
let hosts_lns = (hosts_notify|comment|empty)*
|
||||
|
||||
let hosts_filter = ( incl "@CONFPATH@/hosts.conf" )
|
||||
. Util.stdexcl
|
||||
|
||||
let hosts_xfm = transform hosts_lns hosts_filter
|
||||
Loading…
Add table
Add a link
Reference in a new issue