mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-24 22:00:17 +00:00
Add warning if curl failed
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
31c7c019cb
commit
21897d7fbd
2 changed files with 8 additions and 5 deletions
|
@ -1336,7 +1336,6 @@ curl_to_tricorder() {
|
||||||
# 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_token=$(curl --silent --upload-file ${PIHOLE_DEBUG_LOG} https://tricorder.pi-hole.net)
|
||||||
if [ -z "${tricorder_token}" ]; then
|
if [ -z "${tricorder_token}" ]; then
|
||||||
# curl failed, fallback to nc
|
|
||||||
log_write " * ${COL_GREEN}curl${COL_NC} failed, contact Pi-hole support for assistance."
|
log_write " * ${COL_GREEN}curl${COL_NC} failed, contact Pi-hole support for assistance."
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
12
pihole
12
pihole
|
@ -399,15 +399,19 @@ Branches:
|
||||||
}
|
}
|
||||||
|
|
||||||
tricorderFunc() {
|
tricorderFunc() {
|
||||||
|
local tricorder_token
|
||||||
if [[ ! -p "/dev/stdin" ]]; then
|
if [[ ! -p "/dev/stdin" ]]; then
|
||||||
echo -e " ${INFO} Please do not call Tricorder directly"
|
echo -e " ${INFO} Please do not call Tricorder directly"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
curl --upload-file "-" https://tricorder.pi-hole.net/upload < /dev/stdin
|
tricorder_token="$(curl --silent --upload-file "-" https://tricorder.pi-hole.net/upload < /dev/stdin)"
|
||||||
ret=$?
|
if [ -z "${tricorder_token}" ]; then
|
||||||
echo ""
|
echo -e "${CROSS} uploading failed failed, contact Pi-hole support for assistance."
|
||||||
exit $ret
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Upload successful, your token is: ${COL_BLUE}${tricorder_token}${COL_NC}"
|
||||||
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
updateCheckFunc() {
|
updateCheckFunc() {
|
||||||
|
|
Loading…
Reference in a new issue