Skip to content

Commit

Permalink
nc-diag: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Nov 19, 2017
1 parent c1eb908 commit d1e529e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/ncp-diag
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ echo "interface|$IFACE"

# Certificates
LEOUT="$( /etc/letsencrypt/letsencrypt-auto certificates 2>/dev/null )"
CERTS="$( echo -e "$LEOUT" | grep "Domains:" | awk '{ print $2 }' )"
CDUE="$( echo -e "$LEOUT" | grep "VALID:" | grep -oP "\d+ days" )"
CERTS="$( echo -e "$LEOUT" | grep "Domains:" | awk '{ print $2 }' | tr '\n' ' ' )"
CDUE="$( echo -e "$LEOUT" | grep "VALID:" | grep -oP "\d+ days" | tr '\n' ' ' )"
[[ "$CERTS" == "" ]] && CERTS=none
[[ "$CDUE" == "" ]] && CDUE=none
echo "certificates|$CERTS"
echo "certs due|$CDUE"

RESOLV="$( ping -c 1 "$CERTS" | head -1 | grep -oP '\d{1,3}(.\d{1,3}){3}' )"
RESOLV="$( ping -c 1 "$CERTS" 2>/dev/null | head -1 | grep -oP '\d{1,3}(.\d{1,3}){3}' )"
echo "NAT loopback|$( [[ "$RESOLV" == "$IP" ]] && echo yes || echo no )"

# Other
Expand Down

0 comments on commit d1e529e

Please sign in to comment.