diff options
author | nachoparker <nacho@ownyourbits.com> | 2017-11-19 13:34:07 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2017-11-19 13:44:50 +0300 |
commit | d1e529ea8e13d8e5411e108ab60fb6f97820778b (patch) | |
tree | e633a0e1112c7c4199d733f5457e99e18cd5c034 /bin/ncp-diag | |
parent | c1eb9080d9fadcec229a23220a95dc36c2c80f2f (diff) |
nc-diag: small fixesv0.36.2
Diffstat (limited to 'bin/ncp-diag')
-rwxr-xr-x | bin/ncp-diag | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/ncp-diag b/bin/ncp-diag index 14536b73..b4da0fd4 100755 --- a/bin/ncp-diag +++ b/bin/ncp-diag @@ -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 |