From 7abf3497304075ceafdc370429dada01ea81dfae Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 13 May 2017 21:08:21 +0200 Subject: [PATCH 1/2] Use `echo "ABC" | pihole tricorder` to upload to Pi-hole's medical tricorder. Uses SSL if available. --- pihole | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pihole b/pihole index 4fafe27a..f24461d3 100755 --- a/pihole +++ b/pihole @@ -94,7 +94,7 @@ scanList(){ queryFunc() { method="${3}" - + # If domain contains non ASCII characters, convert domain to punycode if python exists # Cr: https://serverfault.com/a/335079 if [ -z "${2}" ]; then @@ -105,7 +105,7 @@ queryFunc() { else domain="${2}" fi - + # Scan Whitelist, Blacklist and Wildcards lists="/etc/pihole/whitelist.txt /etc/pihole/blacklist.txt $wildcardlist" result=$(scanList ${domain} "${lists}" ${method}) @@ -122,7 +122,7 @@ queryFunc() { [ -n "$method" ] && exact="exact " echo "::: No ${exact}results found for ${domain}" fi - + exit 0 } @@ -268,6 +268,14 @@ piholeCheckoutFunc() { 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() { cat << EOM ::: Control all Pi-hole specific functions @@ -302,6 +310,7 @@ helpFunc() { ::: 'pihole disable 5m' - will disable blocking for 5 minutes ::: restartdns Restart dnsmasq ::: checkout Check out different branches +::: tricorder Upload log to Pi-hole's medical tricorder (uses SSL when possible) EOM exit 0 } @@ -333,5 +342,6 @@ case "${1}" in "-a" | "admin" ) webpageFunc "$@";; "-t" | "tail" ) tailFunc;; "checkout" ) piholeCheckoutFunc "$@";; + "tricorder" ) tricorderFunc;; * ) helpFunc;; esac From 69f361a3a1884879fe18ec8c1dccc09fabfc3815 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 14 May 2017 16:28:35 +0200 Subject: [PATCH 2/2] :taco: is the new :shipit: squirrel --- .pullapprove.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pullapprove.yml b/.pullapprove.yml index 39566b34..188a64f2 100644 --- a/.pullapprove.yml +++ b/.pullapprove.yml @@ -10,7 +10,7 @@ group_defaults: reset_on_push: enabled: true reject_value: -2 - approve_regex: '^(Approved|:shipit:|:\+1:|Engage)' + approve_regex: '^(Approved|:shipit:|:\+1:|Engage|:taco:)' reject_regex: '^(Rejected|:-1:|Borg)' author_approval: auto: true