projects
/
rrq
/
hourglass.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added
[rrq/hourglass.git]
/
siteconfig.lsp
diff --git
a/siteconfig.lsp
b/siteconfig.lsp
index a3bb7b67adaa4fa572a8aaa3829ca011ccd8a3f0..69f0fbb7ded19803550524b536dafd838e56bf0a 100644
(file)
--- a/
siteconfig.lsp
+++ b/
siteconfig.lsp
@@
-3,35
+3,47
@@
(define (set-int K V) (set K (int V 0 10)))
(define (set-ints K V)
(define (set-int K V) (set K (int V 0 10)))
(define (set-ints K V)
- (
map (curry set-int K) (clean empty? (parse V "\\s*,?\\s*" 0
))))
+ (
set K (map int (clean empty? (parse V "(\\s+|\\s*,\\s*)" 0)
))))
(define (set-list K V)
(define (set-list K V)
- (
map (curry set K) (clean empty? (parse V "\\s*,?\\s*
" 0))))
+ (
set K (clean empty? (parse V "(\\s+|\\s*,\\s*)
" 0))))
(constant
'FILE "hourglass.conf"
'KEYS '(
(constant
'FILE "hourglass.conf"
'KEYS '(
- ("libc" set)
("listener.ports" set-ints)
("listener.ports" set-ints)
- ("listener.ip" set)
+ ("listener.net" set)
+ ("listener.log.ip" set)
("listener.activity.dir" set)
("listener.activity.dir" set)
+ ("listener.tap" set)
+
("control.action" set)
("control.dat" set)
("control.net" set)
("control.extra.dat" set)
("control.usage.dat" set)
("control.usage.tmp" set)
("control.action" set)
("control.dat" set)
("control.net" set)
("control.extra.dat" set)
("control.usage.dat" set)
("control.usage.tmp" set)
+ ("control.activity.gap" set-int)
+ ("control.activity.clip" set)
+ ("ipset.bin" set)
+ ("ipset.table" set)
+
("wui.port" set-int)
("wui.port" set-int)
- ("wui.roles" set)
("wui.passwd" set)
("wui.passwd" set)
+
+ ("libc" set)
+ ("tundev" set)
)
)
(define (setting LINE)
)
)
(define (setting LINE)
- (when (regex "^\\s([^;#][^=]*)=(.*)" LINE 0)
+ (when (regex "^\\s
*
([^;#][^=]*)=(.*)" LINE 0)
(let ((KV (map trim (list $1 $2))))
(let ((KV (map trim (list $1 $2))))
- (if (lookup (KV 0) KEYS) (apply $it (list (sym (KV 0)) (KV 1)))))))
+ (if (lookup (KV 0) KEYS)
+ (let ((SET $it) (K (sym (KV 0))) (V (KV 1)))
+ ;(write-line 2 (string (list K V)))
+ (apply SET (list K V)))))))
(map setting (parse (or (read-file FILE) "") "\n"))
(map setting (parse (or (read-file FILE) "") "\n"))