From 0b33b1cb61bcc49cfdf14589935700ac42a6607f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 30 Aug 2024 21:09:10 -0700 Subject: Use a variable for iptables command. --- txrban.txr | 5 +++-- 1 file 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)) -- cgit v1.2.3