3 Parses /etc/sysctl.conf and /etc/sysctl.d/*
5 Author: David Lutterkort <lutter@redhat.com>
10 This file is licenced under the LGPL v2+, like the rest of Augeas.
15 About: Configuration files
16 This lens applies to /etc/sysctl.conf and /etc/sysctl.d/*. See <filter>.
19 The <Test_Sysctl> file contains various examples and tests.
25 (* Variable: filter *)
26 let filter = incl "/boot/loader.conf"
27 . incl "/etc/sysctl.conf"
28 . incl "/etc/sysctl.d/*"
29 . excl "/etc/sysctl.d/README"
30 . excl "/etc/sysctl.d/README.sysctl"
34 let comment = Util.comment_generic /[ \t]*[#;][ \t]*/ "# "
37 basically a Simplevars.entry but key has to allow some special chars as '*' *)
39 let some_value = Sep.space_equal . store Simplevars.to_comment_re
40 (* Rx.word extended by * and : *)
41 in let word = /[*:\/A-Za-z0-9_.-]+/
42 (* Avoid ambiguity in tree by making a subtree here *)
43 in let empty_value = [del /[ \t]*=/ "="] . store ""
44 in [ Util.indent . key word
45 . (some_value? | empty_value)
46 . (Util.eol | Util.comment_eol) ]
50 let lns = (Util.empty | comment | entry)*
52 let xfm = transform lns filter