#!/bin/bash # Comprueba que los recursos de plantilla que pide la portada existen en el mirror set -uo pipefail BASE=/home/rafa/joomla-migration/mirror-antiguo RUN=$(cat "$BASE/CURRENT_RUN") R=$BASE/runs/$RUN/raw/antiguo.feadulta.com P=$R/es/index.html [ -f "$P" ] || { echo "no existe $P"; exit 1; } grep -oE '(href|src)="[^"]+\.(css|js|png|jpg|gif|ico)[^"]*"' "$P" \ | sed 's/^[a-z]*="//; s/"$//' | sort -u > /tmp/portada-assets.txt echo "recursos referenciados por la portada: $(wc -l < /tmp/portada-assets.txt)" ok=0; miss=0 while read -r u; do p=$(echo "$u" | sed 's#^https\?://antiguo.feadulta.com##; s#^/##; s#?.*##') case "$u" in http*://*) case "$u" in *antiguo.feadulta.com*) ;; *) continue;; esac;; esac if [ -f "$R/$p" ]; then ok=$((ok+1)); else miss=$((miss+1)); echo " FALTA: $p"; fi done < /tmp/portada-assets.txt echo "presentes=$ok ausentes=$miss"