diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 26ef61fa..4e2a1ca8 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -1336,7 +1336,6 @@ curl_to_tricorder() { # 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) if [ -z "${tricorder_token}" ]; then - # curl failed, fallback to nc log_write " * ${COL_GREEN}curl${COL_NC} failed, contact Pi-hole support for assistance." fi } diff --git a/pihole b/pihole index 1fba6f4d..e7a6978b 100755 --- a/pihole +++ b/pihole @@ -399,15 +399,19 @@ Branches: } tricorderFunc() { + local tricorder_token if [[ ! -p "/dev/stdin" ]]; then echo -e " ${INFO} Please do not call Tricorder directly" exit 1 fi - curl --upload-file "-" https://tricorder.pi-hole.net/upload < /dev/stdin - ret=$? - echo "" - exit $ret + tricorder_token="$(curl --silent --upload-file "-" https://tricorder.pi-hole.net/upload < /dev/stdin)" + if [ -z "${tricorder_token}" ]; then + echo -e "${CROSS} uploading failed failed, contact Pi-hole support for assistance." + exit 1 + fi + echo "Upload successful, your token is: ${COL_BLUE}${tricorder_token}${COL_NC}" + exit 0 } updateCheckFunc() {