summaryrefslogtreecommitdiffstats
path: root/txrban.txr
diff options
context:
space:
mode:
Diffstat (limited to 'txrban.txr')
-rw-r--r--txrban.txr5
1 files changed, 3 insertions, 2 deletions
diff --git a/txrban.txr b/txrban.txr
index 27b5c10..086f4b0 100644
--- a/txrban.txr
+++ b/txrban.txr
@@ -1,5 +1,6 @@
@(include "config")
@(include "utils")
+@(bind iptables "iptables")
@(do
(defstruct client-info nil
(ip nil)
@@ -55,7 +56,7 @@
(cond
((not cli.banned)
(unless *dry-run*
- (sh `@{*off*}iptables -I INPUT 1 -s @{cli.ip} -i @{*iface*} -j DROP`))
+ (sh `@{*off*}@iptables -I INPUT 1 -s @{cli.ip} -i @{*iface*} -j DROP`))
(debug "banned ~a for ~a starting on ~a\n" cli.ip
(hrtime howlong) (time-string-local time "%c"))
(set cli.banned (rcons time new-until)))
@@ -89,7 +90,7 @@
(defun unban (cli)
(unless *dry-run*
- (sh `@{*off*}iptables -D INPUT -s @{cli.ip} -i @{*iface*} -j DROP`))
+ (sh `@{*off*}@iptables -D INPUT -s @{cli.ip} -i @{*iface*} -j DROP`))
(debug "unbanned ~a\n" cli.ip)
(set cli.banned nil))