Skip to content

Commit b9b7d5f

Browse files
authored
Merge pull request pi-hole#3547 from pi-hole/fix/debug20.04
fallback to NC if curl fails on uploadgit checkout
2 parents ae0d1de + 8491391 commit b9b7d5f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

advanced/Scripts/piholeDebug.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,11 @@ tricorder_use_nc_or_curl() {
12151215
log_write " * Using ${COL_GREEN}curl${COL_NC} for transmission."
12161216
# transmit he log via TLS and store the token returned in a variable
12171217
tricorder_token=$(curl --silent --upload-file ${PIHOLE_DEBUG_LOG} https://tricorder.pi-hole.net:${TRICORDER_SSL_PORT_NUMBER})
1218+
if [ -z "${tricorder_token}" ]; then
1219+
# curl failed, fallback to nc
1220+
log_write " * ${COL_GREEN}curl${COL_NC} failed, falling back to ${COL_YELLOW}netcat${COL_NC} for transmission."
1221+
tricorder_token=$(< ${PIHOLE_DEBUG_LOG} nc tricorder.pi-hole.net ${TRICORDER_NC_PORT_NUMBER})
1222+
fi
12181223
# Otherwise,
12191224
else
12201225
# use net cat

0 commit comments

Comments
 (0)