aboutsummaryrefslogtreecommitdiffstats
path: root/config/countryblock/execute.sh
diff options
context:
space:
mode:
Diffstat (limited to 'config/countryblock/execute.sh')
-rwxr-xr-xconfig/countryblock/execute.sh30
1 files changed, 16 insertions, 14 deletions
diff --git a/config/countryblock/execute.sh b/config/countryblock/execute.sh
index b70894e6..c51cf99e 100755
--- a/config/countryblock/execute.sh
+++ b/config/countryblock/execute.sh
@@ -10,9 +10,10 @@ export t=`grep -n 'User Aliases' /tmp/rules.debug |grep -o '[0-9]\{1,2\}'`
i=$(($i+'1'))
t=$(($t+'1'))
-#echo $i
-#echo $t
-
+#i = line where <snort2c> is
+#t is where 'User Aliases' is
+echo $i
+echo $t
rm /tmp/rules.debug.tmp
@@ -42,21 +43,22 @@ while read line
do a=$(($a+1));
echo $a;
if [ "$a" = "$i" ]; then
- for i in $(cat interfaces.txt); do
echo "" >> /tmp/rules.debug.tmp
echo "#countryblock" >> /tmp/rules.debug.tmp
echo "table <countryblock> persist file '/usr/local/www/packages/countryblock/lists/countries.txt'" >> /tmp/rules.debug.tmp
echo "table <countryblockW> persist file '/usr/local/www/packages/countryblock/countries-white.txt'" >> /tmp/rules.debug.tmp
- echo "pass quick from <countryblockW> to $i label 'countryblock'" >> /tmp/rules.debug.tmp
- echo "pass quick from $i to <countryblockW> label 'countryblock'" >> /tmp/rules.debug.tmp
- if [ -f logging ]; then
- echo "block log quick from <countryblock> to $i label 'countryblock'" >> /tmp/rules.debug.tmp
- else
- echo "block quick from <countryblock> to $i label 'countryblock'" >> /tmp/rules.debug.tmp
- fi
- if [ -f OUTBOUND ]; then
- echo "block quick from $i to <countryblock> label 'countryblock'" >> /tmp/rules.debug.tmp
- fi
+
+ for i in $(cat /usr/local/www/packages/countryblock/interfaces.txt); do
+ echo "pass quick from <countryblockW> to $i label 'countryblock'" >> /tmp/rules.debug.tmp
+ echo "pass quick from $i to <countryblockW> label 'countryblock'" >> /tmp/rules.debug.tmp
+ if [ -f logging ]; then
+ echo "block log quick from <countryblock> to $i label 'countryblock'" >> /tmp/rules.debug.tmp
+ else
+ echo "block quick from <countryblock> to $i label 'countryblock'" >> /tmp/rules.debug.tmp
+ fi
+ if [ -f OUTBOUND ]; then
+ echo "block quick from $i to <countryblock> label 'countryblock'" >> /tmp/rules.debug.tmp
+ fi
done
fi
echo $line >> /tmp/rules.debug.tmp