Hello all - Scripting n00b here. I'm setting up the UFW and I have a file with about 80,000 commands I need to run. I figured I would just loop through the file and execute the commands, but I'm have an issue doing it. Need some help. Here's what I built so far:
SetupUFW.sh
Code:
#!/bin/bash
while read p; do
echo "$p"
done < BlockList.txt
BlockList.txt (80,000 lines that look like this
Code:
sudo ufw deny from 1.0.1.0/24
sudo ufw deny from 1.0.2.0/23
sudo ufw deny from 1.0.8.0/21
As you can see, I'm trying to loop through the file called BlockList.txt as I have already built it with the commands necessary. How can I loop through each line and execute the lines? Any help you can provide would be appreciated.