diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-08-30 21:09:10 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-08-30 21:09:10 -0700 |
commit | 0b33b1cb61bcc49cfdf14589935700ac42a6607f (patch) | |
tree | b400e69e2496a27edaa469d99f892b2a4d4c4f6c | |
parent | 3539d92a0260a2095a16bc61ada6a76e48120dac (diff) | |
download | txrban-0b33b1cb61bcc49cfdf14589935700ac42a6607f.tar.gz txrban-0b33b1cb61bcc49cfdf14589935700ac42a6607f.tar.bz2 txrban-0b33b1cb61bcc49cfdf14589935700ac42a6607f.zip |
Use a variable for iptables command.
-rw-r--r-- | txrban.txr | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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)) |