• Vitaly Lipatov's avatar
    router: filter dig diagnostics from gateway resolve and PTR lookup · 097fea9d
    Vitaly Lipatov authored
    When DNS times out, "dig +short" can emit ";; communications error to
    SERVER#53: timed out" to stdout (not just stderr). resolve_gw's
    grep -m1 '[0-9]' would accept that line as an "IP" (it contains
    "10#53"); gw_monitor_tag would carry it through sed and produce a
    multi-line tag. The latter ended up as state directory names like
    "gw-;; communications error to ...\\nikev2.hetzner.v6/".
    
    Wrap dig in 2>/dev/null and filter "^;" diagnostics; in gw_monitor_tag
    also take only the first PTR line.
    097fea9d