[ale] bonehead ipset additions
Alex Carver
agcarver+ale at acarver.net
Mon Feb 14 01:38:20 EST 2022
Yeah, unfortunately that doesn't help because I do want to have the
comments sometimes. I have some rulesets specific to entities so I
don't need them there but for a couple of the catch-all lists I need the
comments to remind me later. That's the reason for the script, to
handle comments or not.
On 2022-02-13 20:31, DJPfulio--- via Ale wrote:
> My script to do this is 4 lines.
> No error checking.
> I didn't want to overthink it. I don't even check that the euid is 0.
> That's solved by placing the script in ~root/bin/. K.I.S.S.
>
> #!/bin/bash
>
> IPSET_RULES_FILE="/etc/ipset.up.rules"
>
> # Make a backup
> cp $IPSET_RULES_FILE $IPSET_RULES_FILE.bak
>
> # Update the live ruleset - any errors?
> ipset add countryblock $1
>
> # Append the new rule to the bottom
> echo "add countryblock $1 " | tee -a $IPSET_RULES_FILE
>
>
> On 2/13/22 17:50, Alex Carver via Ale wrote:
>> I'm putting a tiny utility script together to make it faster for me
>> to update ipset lists and add them to a restore file in one shot but
>> I've run into a slight hiccup with what I wanted to accomplish.
>>
>
> Lots of brilliant stuff deleted.
>
>>
>> Thoughts? _______________________________________________
>
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> https://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
More information about the Ale
mailing list