O
O
ObehanProger2019-07-29 08:49:59
bash
ObehanProger, 2019-07-29 08:49:59

How to iterate over ipset and add new ips to it from a file?

How to iterate over ipset badips and add new ip abcd there if it is not in this list? Something like, but I don't know how:

sudo cat iplist.txt | while read line
do
 if($(ipset test badips $line)=='$line is NOT in set bots') sudo ipset -A badips $line
done

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2019-07-29
@q2digger

just add. if there is no address there, it will be added; if there is, it will be ignored.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question