1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 14:58:08 +00:00

Use echo "ABC" | pihole tricorder to upload to Pi-hole's medical tricorder. Uses SSL if available.

This commit is contained in:
DL6ER 2017-05-13 21:08:21 +02:00
parent b166410cbf
commit 7abf349730
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

10
pihole
View File

@ -268,6 +268,14 @@ piholeCheckoutFunc() {
checkout "$@" checkout "$@"
} }
tricorderFunc() {
if command -v openssl &> /dev/null; then
openssl s_client -quiet -connect tricorder.pi-hole.net:9998 2> /dev/null < /dev/stdin
else
nc tricorder.pi-hole.net 9999 < /dev/stdin
fi
}
helpFunc() { helpFunc() {
cat << EOM cat << EOM
::: Control all Pi-hole specific functions ::: Control all Pi-hole specific functions
@ -302,6 +310,7 @@ helpFunc() {
::: 'pihole disable 5m' - will disable blocking for 5 minutes ::: 'pihole disable 5m' - will disable blocking for 5 minutes
::: restartdns Restart dnsmasq ::: restartdns Restart dnsmasq
::: checkout Check out different branches ::: checkout Check out different branches
::: tricorder Upload log to Pi-hole's medical tricorder (uses SSL when possible)
EOM EOM
exit 0 exit 0
} }
@ -333,5 +342,6 @@ case "${1}" in
"-a" | "admin" ) webpageFunc "$@";; "-a" | "admin" ) webpageFunc "$@";;
"-t" | "tail" ) tailFunc;; "-t" | "tail" ) tailFunc;;
"checkout" ) piholeCheckoutFunc "$@";; "checkout" ) piholeCheckoutFunc "$@";;
"tricorder" ) tricorderFunc;;
* ) helpFunc;; * ) helpFunc;;
esac esac