Posted to tcl by Stu at Fri Mar 29 14:29:51 GMT 2024view pretty

# Slop filter "botstopper"

proc filter_init {} { variable filter_bots [list claudebot] }

proc filter_bots {} { variable filter_bots; return $filter_bots }

proc filter_do {d} {
        set ua_bot [format_ua_bot [dict get $d ua]]
        if {$ua_bot ni [filter_bots]} skip
        set ip [dict get $d ip]
        exec -ignorestderr /usr/bin/doas /sbin/pfctl -tbots -Tadd $ip 2>@1
        #ok "Added $ua_bot [dict get $d ip]"
        skip
}

# EOF