mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Merge pull request #3547 from pi-hole/fix/debug20.04
fallback to NC if curl fails on uploadgit checkout
This commit is contained in:
commit
b9b7d5f8eb
1 changed files with 5 additions and 0 deletions
|
@ -1215,6 +1215,11 @@ tricorder_use_nc_or_curl() {
|
||||||
log_write " * Using ${COL_GREEN}curl${COL_NC} for transmission."
|
log_write " * Using ${COL_GREEN}curl${COL_NC} for transmission."
|
||||||
# transmit he log via TLS and store the token returned in a variable
|
# transmit he log via TLS and store the token returned in a variable
|
||||||
tricorder_token=$(curl --silent --upload-file ${PIHOLE_DEBUG_LOG} https://tricorder.pi-hole.net:${TRICORDER_SSL_PORT_NUMBER})
|
tricorder_token=$(curl --silent --upload-file ${PIHOLE_DEBUG_LOG} https://tricorder.pi-hole.net:${TRICORDER_SSL_PORT_NUMBER})
|
||||||
|
if [ -z "${tricorder_token}" ]; then
|
||||||
|
# curl failed, fallback to nc
|
||||||
|
log_write " * ${COL_GREEN}curl${COL_NC} failed, falling back to ${COL_YELLOW}netcat${COL_NC} for transmission."
|
||||||
|
tricorder_token=$(< ${PIHOLE_DEBUG_LOG} nc tricorder.pi-hole.net ${TRICORDER_NC_PORT_NUMBER})
|
||||||
|
fi
|
||||||
# Otherwise,
|
# Otherwise,
|
||||||
else
|
else
|
||||||
# use net cat
|
# use net cat
|
||||||
|
|
Loading…
Reference in a new issue