forked from networkupstools/nut
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
scripts/augeas/nutnutconf.aug.in: handle "nut.conf" keywords introduc…
…ed between NUT 2.6.5 and 2.8.2 [networkupstools#2294] Signed-off-by: Jim Klimov <[email protected]>
- Loading branch information
Showing
1 changed file
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ Module: NutNutConf | |
Parses @CONFPATH@/nut.conf | ||
|
||
Author: Frederic Bohe <[email protected]> | ||
Jim Klimov <[email protected]> | ||
|
||
About: License | ||
This file is licensed under the GPL. | ||
|
@@ -32,15 +33,48 @@ let eol = Util.eol | |
let comment = Util.comment | ||
let empty = Util.empty | ||
|
||
(* note different definitions than in other configs - this one is shell-syntax *) | ||
let bool = /true|false|"true"|"false"|'true'|'false'/ | ||
let num = /[0-9]+|"[0-9]+"|'[0-9]+'/ | ||
let num_signed = /[+-]?[0-9]+|"[+-]?[0-9]+"|'[+-]?[0-9]+'/ | ||
let word = /[^"#; \t\n]+/ | ||
|
||
(* Variable: quoted_word *) | ||
let word_space = /"[^"\n]+"/ | ||
let quoted_word = /"[^" \t\n]+"|'[^' \t\n]+'/ | ||
|
||
(* Variable: word_all *) | ||
let word_all = word_space | word | quoted_word | ||
|
||
let nut_possible_mode = "none" | ||
| "standalone" | ||
| "netserver" | ||
| "netclient" | ||
| "controlled" | ||
| "manual" | ||
|
||
let nut_mode = [ sep_spc . key "MODE" . def_sep . sep_spc . store nut_possible_mode . eol ] | ||
|
||
let nut_lns = (nut_mode|comment|empty)* | ||
let nut_bool_re = "ALLOW_NO_DEVICE" | ||
| "ALLOW_NOT_ALL_LISTENERS" | ||
| "POWEROFF_QUIET" | ||
|
||
let nut_bool = [ sep_spc . key nut_bool_re . def_sep . sep_spc . store bool . eol ] | ||
|
||
let nut_num_re = "POWEROFF_WAIT" | ||
|
||
let nut_num = [ sep_spc . key nut_num_re . def_sep . sep_spc . store num . eol ] | ||
|
||
let nut_num_signed_re = "NUT_DEBUG_LEVEL" | ||
|
||
let nut_num_signed = [ sep_spc . key nut_num_signed_re . def_sep . sep_spc . store num_signed . eol ] | ||
|
||
let nut_word_all_re = "UPSD_OPTIONS" | ||
| "UPSMON_OPTIONS" | ||
|
||
let nut_word_all = [ sep_spc . key nut_word_all_re . def_sep . sep_spc . store word_all . eol ] | ||
|
||
let nut_lns = (nut_mode|nut_bool|nut_num|nut_num_signed|nut_word_all|comment|empty)* | ||
|
||
let nut_filter = ( incl "@CONFPATH@/nut.conf" ) | ||
. Util.stdexcl | ||
|