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
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
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