1(* 2Module: NutUpsConf 3 Parses @CONFPATH@/ups.conf 4 5Author: Raphael Pinson <raphink@gmail.com> 6 Frederic Bohe <fredericbohe@eaton.com> 7 Arnaud Quette <arnaud.quette@gmail.com> 8 9About: License 10 This file is licensed under the GPL. 11 12About: Lens Usage 13 Sample usage of this lens in augtool 14 15 * Print all drivers used 16 > print /files/@CONFPATH@/ups.conf/*/driver 17 18About: Configuration files 19 This lens applies to @CONFPATH@/ups.conf. See <filter>. 20*) 21 22module NutUpsConf = 23 autoload ups_xfm 24 25(************************************************************************ 26 * Group: UPS.CONF 27 *************************************************************************) 28 29let ups_comment = IniFile.comment IniFile.comment_re IniFile.comment_default 30 31let ups_sep = IniFile.sep IniFile.sep_re IniFile.sep_default 32 33let ups_global = "chroot" 34 | "driverpath" 35 | "maxstartdelay" 36 | "maxretry" 37 | "retrydelay" 38 | "pollinterval" 39 | "synchronous" 40 | "user" 41 42let ups_fields = "driver" 43 | "port" 44 | "sdorder" 45 | "desc" 46 | "nolock" 47 | "ignorelb" 48 | "maxstartdelay" 49 | "synchronous" 50@SPECIFIC_DRV_VARS@ 51 52let ups_entry = IniFile.indented_entry (ups_global|ups_fields) ups_sep ups_comment 53 54let ups_title = IniFile.indented_title IniFile.record_re 55 56let ups_record = IniFile.record ups_title ups_entry 57 58let ups_lns = IniFile.lns ups_record ups_comment 59 60let ups_filter = (incl "@CONFPATH@/ups.conf") 61 . Util.stdexcl 62 63let ups_xfm = transform ups_lns ups_filter 64