IPTables Script Question
I have this script that drops packets coming from IP's that I list in a text file. My question is what does "for BLOCKED_IP in 'cat /root/geoblock.txt '" mean?
I know that it is reading from the file /root/geoblock.txt but I'm not sure what "for BLOCKED_IP" means. In my text file, all i have is a list of IPs. Do I have to change the text file to include BLOCKED_IP in it? Code:
#!/bin/bash Thanks! |
Its the variable being assigned to the values in the geoblock file. So basically for each value in the file assign the name BLOCKED_IP to it. Then that variable is read into the Do loop. The $BLOCKED_IP is referencing a variable defined within the script.
Output would look something like Code:
iptables -A INPUT -s 10.1.1.2 -j DROP |
Thanks a lot
|
All times are GMT -5. The time now is 02:11 AM. |