#!/bin/sh
F=/var/lib/cdebconf/templates.dat
echo "=== 命中行 ==="
grep -n -e 'ignore the problem' -e 'continue without all' -e 'access the mirror' "$F" 2>/dev/null | head
N=$(grep -n -e 'ignore the problem' -e 'continue without all' "$F" 2>/dev/null | head -1 | cut -d: -f1)
echo "=== 该问题记录(N=$N，往上22行找 Name/Choices) ==="
[ -n "$N" ] && sed -n "$((N-22)),${N}p" "$F"
