@@ -56,9 +56,11 @@ if $DNSCRYPT_PROXY -config "$CONFIG" -list -json 2>/dev/null | grep -F '"dnssec"
5656 DNSSEC=true
5757fi
5858
59- # Show certificate info (silent mode)
60- if ! $DNSCRYPT_PROXY -config " $CONFIG " -show-certs > /dev/null 2>&1 ; then
59+ # Show certificate info
60+ CERTOUT=$( $DNSCRYPT_PROXY -config " $CONFIG " -show-certs 2>&1 )
61+ if [ $? -ne 0 ]; then
6162 echo " Error: Failed to retrieve certificate information" >&2
63+ echo " $CERTOUT " >&2
6264 exit 1
6365fi
6466
@@ -80,7 +82,7 @@ RETRIES=3
8082SUCCESS=false
8183
8284for i in $( seq 1 $RETRIES ) ; do
83- if $DNSCRYPT_PROXY -config " $CONFIG " -resolve " example.com" > /tmp/resolve-output 2> /dev/null ; then
85+ if $DNSCRYPT_PROXY -config " $CONFIG " -resolve " example.com" > /tmp/resolve-output 2>&1 ; then
8486 # Check DNSSEC if expected
8587 if [ " $DNSSEC " = " true" ]; then
8688 if grep -F " resolver doesn't support DNSSEC" /tmp/resolve-output > /dev/null; then
9698
9799# Clean up
98100kill $( cat " $PIDFILE " ) 2> /dev/null
99- rm -f /tmp/resolve-output
100101
101102# Return result
102103if [ " $SUCCESS " = " true" ]; then
104+ rm -f /tmp/resolve-output
103105 echo " OK: Resolver is working"
104106 exit 0
105107else
106108 echo " FAIL: Unable to resolve queries" >&2
109+ if [ -f /tmp/resolve-output ] && [ -s /tmp/resolve-output ]; then
110+ echo " --- resolve output ---" >&2
111+ cat /tmp/resolve-output >&2
112+ fi
113+ if [ -f " $LOGFILE " ] && [ -s " $LOGFILE " ]; then
114+ echo " --- proxy log ---" >&2
115+ tail -n 20 " $LOGFILE " >&2
116+ fi
117+ rm -f /tmp/resolve-output
107118 exit 1
108119fi
0 commit comments