From: Ralph Ronnquist Date: Wed, 5 Jan 2022 06:58:43 +0000 (+1100) Subject: final debugging X-Git-Tag: 0.1~9 X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=5fe9ada5d3f2fe26426c1a807b778b8f8df0ba94;p=rrq%2Fhourglass.git final debugging --- diff --git a/control-logic.lsp b/control-logic.lsp index bdf291d..2d2cd3e 100644 --- a/control-logic.lsp +++ b/control-logic.lsp @@ -14,8 +14,9 @@ 'ACTDIR SITE:listener.activity.dir 'CONTROL.DAT SITE:control.dat 'EXTRA.DAT SITE:control.extra.dat - 'USAGE.DAT SITE:usage.dat - 'USAGE.TMP SITE:usage.tmp + 'USAGE.DAT SITE:control.usage.dat + 'USAGE.TMP SITE:control.usage.tmp + 'ACTION SITE:control.action ) # Set current time variables in local timezone @@ -32,10 +33,13 @@ ) # Load CONTROL.DAT -# ( (control "file") (gap minutes) ( weekday start limit stop ) ... ) +# (( weekday start limit stop ) ... ) (setf CONTROL (read-expr (or (read-file CONTROL.DAT) (die "** Missing " CONTROL.DAT " ** Exiting.")) )) + +(write-line 2 (string (list CONTROL DOW))) + (map set '(dow MODE START LIMIT END) (or (assoc DOW CONTROL) (assoc 'policy CONTROL) @@ -43,10 +47,10 @@ ) # Load the configured control mechanism -(if (lookup 'control CONTROL) (load $it) +(if (file? ACTION) (load ACTION) (die "** Unknown control mechanism. Exiting!!")) (unless control - (die "** Control function (control cmd reason) not defined. Exiting!!")) + (die "** Control function (control cmd reason) not defined. Exiting!!")) ;; Apply control command with reason, then exit (define (do-control x r) (control x r) (exit 0)) diff --git a/hourglass.conf b/hourglass.conf index 838e137..f7b87bb 100644 --- a/hourglass.conf +++ b/hourglass.conf @@ -1,23 +1,23 @@ ; Hourglass site configuration -listener.net = 192.168.255 -listener.ports = 80 443 +listener.net = 192.168.255 +listener.ports = 80 443 1080 listener.activity.dir = activity listener.tap = hourglass control.action = ipset-control.lsp control.dat = control.dat -control.net = 10.0.0.0/8 +control.net = 10.0.0.0/24 control.extra.dat = control-extra.dat control.usage.dat = usage.dat control.usage.tmp = .usage.dat control.activity.gap = 10 control.activity.clip = 1000 -ipset.bin = /sbin/ipset +ipset.bin = /usr/sbin/ipset ipset.table = TIMO wui.port = 1070 -wui.passwd = .htpassswd +wui.passwd = htpasswd libc = /lib/x86_64-linux-gnu/libc.so.6 tundev = /dev/net/tun diff --git a/ipset-control.lsp b/ipset-control.lsp index cd81384..8d93172 100644 --- a/ipset-control.lsp +++ b/ipset-control.lsp @@ -1,6 +1,6 @@ # Should load from "ipset.cfg" -(constant 'IPSET SITE:ipset.bin 'TABLE SITE:ipset.table NET SITE:control.net) +(constant 'IPSET SITE:ipset.bin 'TABLE SITE:ipset.table 'NET SITE:control.net) ;; Return current low-leve "close" or "open" status (define (current-status)