Crack propagation induced by thermal shocks in structured media