feat: mail ipv6/rdns checks and taler-ops catalog
This commit is contained in:
parent
18a4fec2dd
commit
6200a4d031
2 changed files with 34 additions and 1 deletions
|
|
@ -213,12 +213,44 @@ while IFS= read -r line || [ -n "$line" ]; do
|
|||
h=$(echo "$h" | tr '[:upper:]' '[:lower:]' | sed 's/\.$//;s/^[[:space:]]*//;s/[[:space:]]*$//')
|
||||
[ -z "$h" ] && continue
|
||||
|
||||
addrs=$(dns_a "$h" | tr '\n' ' ')
|
||||
mapfile -t _a4 < <(dns_a "$h" | sed '/^$/d')
|
||||
addrs=$(printf '%s ' "${_a4[@]}")
|
||||
if [ -z "${addrs// }" ]; then
|
||||
fail "dns" "$h does not resolve (A/AAAA)"
|
||||
continue
|
||||
fi
|
||||
ok "dns" "$h → $addrs"
|
||||
# Explicit IPv6 signal
|
||||
_has_v4=0
|
||||
_has_v6=0
|
||||
for _ip in "${_a4[@]}"; do
|
||||
case "$_ip" in
|
||||
*:*) _has_v6=1 ;;
|
||||
*) _has_v4=1 ;;
|
||||
esac
|
||||
done
|
||||
if [ "$_has_v4" = "1" ] && [ "$_has_v6" = "0" ]; then
|
||||
warn "ipv6" "$h has A but no AAAA"
|
||||
elif [ "$_has_v6" = "1" ]; then
|
||||
ok "ipv6" "$h has AAAA"
|
||||
fi
|
||||
# Reverse DNS (PTR) on first IPv4
|
||||
for _ip in "${_a4[@]}"; do
|
||||
case "$_ip" in
|
||||
*:*) continue ;;
|
||||
esac
|
||||
if command -v dig >/dev/null 2>&1; then
|
||||
ptr=$(dig +short +time=3 +tries=2 -x "$_ip" 2>/dev/null | sed 's/\.$//' | tr '\n' ' ')
|
||||
else
|
||||
ptr=$(host "$_ip" 2>/dev/null | awk '/domain name pointer/{print $NF}' | sed 's/\.$//' | tr '\n' ' ')
|
||||
fi
|
||||
if [ -n "${ptr// }" ]; then
|
||||
ok "rdns" "$_ip PTR → $ptr"
|
||||
else
|
||||
warn "rdns" "$_ip has no PTR"
|
||||
fi
|
||||
break
|
||||
done
|
||||
|
||||
# skip full protocol re-probe if already done
|
||||
if [ "${HOST_DONE[$h]:-}" = "1" ]; then
|
||||
|
|
|
|||
Reference in a new issue