Moved chain jump, to fix duplicate jump bug.
@@ -24,6 +24,8 @@ if $FIREWALL -L $CHAIN_NAME -n &> /dev/null; then
else
# echo "Creating chain $CHAIN_NAME."
$FIREWALL -N $CHAIN_NAME
+ # Jump to the our chain from the FORWARD CHAIN
+ $FIREWALL -A FORWARD -j $CHAIN_NAME
fi
# echo "Processing the bad guys list..."
@@ -38,9 +40,6 @@ while IFS= read -r ip; do
done < "$BADGUYS_FILE"
-# Jump to the our chain from the FORWARD CHAIN
-$FIREWALL -A FORWARD -j $CHAIN_NAME
-
# Delete the bad guys file
rm $BADGUYS_FILE