|
Packit Service |
a2ae7a |
(*
|
|
Packit Service |
a2ae7a |
Module: Thttpd
|
|
Packit Service |
a2ae7a |
Parses Thttpd's configuration files
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
Author: Marc Fournier <marc.fournier@camptocamp.com>
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: Reference
|
|
Packit Service |
a2ae7a |
This lens is based on Thttpd's default thttpd.conf file.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: Usage Example
|
|
Packit Service |
a2ae7a |
(start code)
|
|
Packit Service |
a2ae7a |
augtool> get /files/etc/thttpd/thttpd.conf/port
|
|
Packit Service |
a2ae7a |
/files/etc/thttpd/thttpd.conf/port = 80
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
augtool> set /files/etc/thttpd/thttpd.conf/port 8080
|
|
Packit Service |
a2ae7a |
augtool> save
|
|
Packit Service |
a2ae7a |
Saved 1 file(s)
|
|
Packit Service |
a2ae7a |
(end code)
|
|
Packit Service |
a2ae7a |
The <Test_Thttpd> file also contains various examples.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: License
|
|
Packit Service |
a2ae7a |
This file is licensed under the LGPL v2+, like the rest of Augeas.
|
|
Packit Service |
a2ae7a |
*)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
module Thttpd =
|
|
Packit Service |
a2ae7a |
autoload xfm
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let comment = Util.comment
|
|
Packit Service |
a2ae7a |
let comment_eol = Util.comment_generic /[ \t]*[#][ \t]*/ " # "
|
|
Packit Service |
a2ae7a |
let empty = Util.empty
|
|
Packit Service |
a2ae7a |
let eol = Util.del_str "\n"
|
|
Packit Service |
a2ae7a |
let bol = Util.del_opt_ws ""
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let kvkey = /(port|dir|data_dir|user|cgipat|throttles|host|logfile|pidfile|charset|p3p|max_age)/
|
|
Packit Service |
a2ae7a |
let flag = /(no){0,1}(chroot|symlinks|vhost|globalpasswd)/
|
|
Packit Service |
a2ae7a |
let val = /[^\n# \t]*/
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let kventry = key kvkey . Util.del_str "=" . store val
|
|
Packit Service |
a2ae7a |
let flagentry = key flag
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let kvline = [ bol . kventry . (eol|comment_eol) ]
|
|
Packit Service |
a2ae7a |
let flagline = [ bol . flagentry . (eol|comment_eol) ]
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let lns = (kvline|flagline|comment|empty)*
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let filter = incl "/etc/thttpd/thttpd.conf"
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let xfm = transform lns filter
|