|
|
|
@ -405,12 +405,17 @@ tricorderFunc() {
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
tricorder_token="$(curl --no-progress-meter --upload-file "-" https://tricorder.pi-hole.net/upload < /dev/stdin)"
|
|
|
|
|
if [ -z "${tricorder_token}" ]; then
|
|
|
|
|
echo -e "${CROSS} uploading failed, contact Pi-hole support for assistance."
|
|
|
|
|
exit 1
|
|
|
|
|
tricorder_token=$(curl --silent --fail --show-error --upload-file "-" https://tricorder.pi-hole.net/upload < /dev/stdin 2>&1)
|
|
|
|
|
if [[ "${tricorder_token}" != "https://tricorder.pi-hole.net/"* ]]; then
|
|
|
|
|
echo -e "${CROSS} uploading failed, contact Pi-hole support for assistance."
|
|
|
|
|
# Log curl error (if available)
|
|
|
|
|
if [ ! -z "${tricorder_token}" ]; then
|
|
|
|
|
echo -e "${INFO} Error message: ${COL_RED}${tricorder_token}${COL_NC}\\n"
|
|
|
|
|
tricorder_token=""
|
|
|
|
|
fi
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
echo "Upload successful, your token is: ${COL_BLUE}${tricorder_token}${COL_NC}"
|
|
|
|
|
echo "Upload successful, your token is: ${COL_GREEN}${tricorder_token}${COL_NC}"
|
|
|
|
|
exit 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|