update http proxy checks

Catalin-Emil Fetoiu committed Oct 23, 2023 at 10:33 UTC e36d9bdd0976b816ffdeef580e838b2510352e7c
1 file changed +8 -9
diagnostics/networking.sh
+8 -9
@@ -11,15 +11,14 @@ ip route show table all
11 ip neighbor
12 ip link
13
14 -set +u
15 -[[ ! -v http_proxy ]] && echo "http_proxy is not set" || echo "http_proxy is set"
16 -[[ ! -v HTTP_PROXY ]] && echo "HTTP_PROXY is not set" || echo "HTTP_PROXY is set"
17 -[[ ! -v https_proxy ]] && echo "https_proxy is not set" || echo "https_proxy is set"
18 -[[ ! -v HTTPS_PROXY ]] && echo "HTTPS_PROXY is not set" || echo "HTTPS_PROXY is set"
19 -[[ ! -v no_proxy ]] && echo "no_proxy is not set" || echo "no_proxy is set"
20 -[[ ! -v NO_PROXY ]] && echo "NO_PROXY is not set" || echo "NO_PROXY is set"
21 -[[ ! -v WSL_PAC_URL ]] && echo "WSL_PAC_URL is not set" || echo "WSL_PAC_URL is set"
22 -set -u
14 +# We only print whether the HTTP proxy variables are set or not, as their content might contain secrets such as usernames, passwords.
15 +if [ -z ${http_proxy+x} ]; then echo "http_proxy is unset"; else echo "http_proxy is set"; fi
16 +if [ -z ${HTTP_PROXY+x} ]; then echo "HTTP_PROXY is unset"; else echo "HTTP_PROXY is set"; fi
17 +if [ -z ${https_proxy+x} ]; then echo "https_proxy is unset"; else echo "https_proxy is set"; fi
18 +if [ -z ${HTTPS_PROXY+x} ]; then echo "HTTPS_PROXY is unset"; else echo "HTTPS_PROXY is set"; fi
19 +if [ -z ${no_proxy+x} ]; then echo "no_proxy is unset"; else echo "no_proxy is set"; fi
20 +if [ -z ${NO_PROXY+x} ]; then echo "NO_PROXY is unset"; else echo "NO_PROXY is set"; fi
21 +if [ -z ${WSL_PAC_URL+x} ]; then echo "WSL_PAC_URL is unset"; else echo "WSL_PAC_URL is set"; fi
22
23 echo "Printing DNS configuration"
24 cat /etc/resolv.conf