0

I have a text file with the following content:

1.1.1.1
2.2.2.2
3.3.3.3
4.4.4.4

How to extract the content of each line and use it as a variable to allow firewall-cmd to read and write rules

KamilCuk
  • 120,984
  • 8
  • 59
  • 111

1 Answers1

0

firewall-cmd has flags --add-entries-from-file and --remove-entries-from-file to read from a text file.

Try something lie

firewall-cmd --permanent --ipset=xxx --add-entries-from-file=file.txt

Uberhumus
  • 921
  • 1
  • 13
  • 24