From f45eb84d6bbb8946c01315812bbd1631ad685c29 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Thu, 14 Jul 2016 11:27:47 -0700 Subject: [PATCH 1/8] Add distribution Check --- advanced/Scripts/piholeDebug.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index dfe9f4ac..8d0d3fa7 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -67,6 +67,14 @@ function versionCheck { echo >> $DEBUG_LOG } +function distroCheck { + echo "#######################################" >> $DEBUG_LOG + echo "######## Distribution Section #########" >> $DEBUG_LOG + echo "#######################################" >> $DEBUG_LOG + + TMP=$(cat /etc/lsb-release/ || echo "Failed to find lsb") + echo "Distribution Version: $TMP" >> $DEBUG_LOG + function compareWhitelist { if [ ! -f "$WHITELISTMATCHES" ]; then $SUDO touch $WHITELISTMATCHES @@ -195,6 +203,7 @@ echo "$GATEWAY_CHECK" >> $DEBUG_LOG echo >> $DEBUG_LOG versionCheck +distroCheck compareWhitelist compareBlacklist testNslookup From b011e5f838e74e808856a426fa11b2cfc08339cb Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Thu, 14 Jul 2016 11:35:52 -0700 Subject: [PATCH 2/8] Add os-release check --- advanced/Scripts/piholeDebug.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 8d0d3fa7..86bff3c2 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -72,7 +72,7 @@ function distroCheck { echo "######## Distribution Section #########" >> $DEBUG_LOG echo "#######################################" >> $DEBUG_LOG - TMP=$(cat /etc/lsb-release/ || echo "Failed to find lsb") + TMP=$(cat /etc/lsb-release/ || cat /etc/os-release || echo "Failed to find release") echo "Distribution Version: $TMP" >> $DEBUG_LOG function compareWhitelist { From 11f2524b9b2d8ad2a4d423d00dc37727c91803de Mon Sep 17 00:00:00 2001 From: Sander Date: Thu, 14 Jul 2016 20:47:27 +0200 Subject: [PATCH 3/8] Instead of an or, cat *release --- advanced/Scripts/piholeDebug.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 86bff3c2..fdb7847d 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -72,7 +72,7 @@ function distroCheck { echo "######## Distribution Section #########" >> $DEBUG_LOG echo "#######################################" >> $DEBUG_LOG - TMP=$(cat /etc/lsb-release/ || cat /etc/os-release || echo "Failed to find release") + TMP=$(cat /etc/*release/ || echo "Failed to find release") echo "Distribution Version: $TMP" >> $DEBUG_LOG function compareWhitelist { From 6f068e0b9c3696d1ecbb0fbc139e2cca696ad3f1 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Fri, 15 Jul 2016 19:32:49 +0100 Subject: [PATCH 4/8] Replace sprunge.us with termbin, which appears to be more reliable. --- advanced/Scripts/piholeDebug.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index fdb7847d..87a87f88 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -340,12 +340,12 @@ function dumpPiHoleLog { # Anything to be done after capturing of pihole.log terminates function finalWork { echo "::: Finshed debugging!" - SPRUNGE=$(cat /var/log/pihole_debug.log | curl --silent --connect-timeout 5 -F 'sprunge=<-' http://sprunge.us) + TERMBIN=$(cat /var/log/pihole_debug.log | nc termbin.com 9999) - # Check if sprunge.us is reachable. When it's not, point to local log instead - if [ -n "$SPRUNGE" ] + # Check if termbin.com is reachable. When it's not, point to local log instead + if [ -n "$TERMBIN" ] then - echo "::: Debug log can be found at : $SPRUNGE" + echo "::: Debug log can be found at : $TERMBIN" else echo "::: Debug log can be found at : /var/log/pihole_debug.log" fi From e106ff0fef36682da16c26fe3b43559d2f24e25f Mon Sep 17 00:00:00 2001 From: Promofaux Date: Fri, 15 Jul 2016 19:58:26 +0100 Subject: [PATCH 5/8] Add netcat to dependencies for termbin.com. Should be installed by default, but JUST IN CASE. --- automated install/basic-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 9474d729..bd6722ee 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -67,7 +67,7 @@ if [ -x "$(command -v rpm)" ];then PKG_INSTALL="$PKG_MANAGER install -y" PKG_COUNT="$PKG_MANAGER check-update | grep -v ^Last | grep -c ^[a-zA-Z0-9]" INSTALLER_DEPS=( iproute net-tools procps-ng newt ) - PIHOLE_DEPS=( epel-release bind-utils bc dnsmasq lighttpd lighttpd-fastcgi php-common php-cli php git curl unzip wget findutils cronie sudo ) + PIHOLE_DEPS=( epel-release bind-utils bc dnsmasq lighttpd lighttpd-fastcgi php-common php-cli php git curl unzip wget findutils cronie sudo netcat ) LIGHTTPD_USER="lighttpd" LIGHTTPD_GROUP="lighttpd" LIGHTTPD_CFG="lighttpd.conf.fedora" @@ -83,7 +83,7 @@ elif [ -x "$(command -v apt-get)" ];then PKG_INSTALL="$PKG_MANAGER --yes --quiet install" PKG_COUNT="$PKG_MANAGER -s -o Debug::NoLocking=true upgrade | grep -c ^Inst" INSTALLER_DEPS=( apt-utils whiptail dhcpcd5) - PIHOLE_DEPS=( dnsutils bc dnsmasq lighttpd php5-common php5-cgi php5 git curl unzip wget sudo ) + PIHOLE_DEPS=( dnsutils bc dnsmasq lighttpd php5-common php5-cgi php5 git curl unzip wget sudo netcat ) LIGHTTPD_USER="www-data" LIGHTTPD_GROUP="www-data" LIGHTTPD_CFG="lighttpd.conf.debian" From e942440bb7c558f62e3684b9ca5a9d76be905fe3 Mon Sep 17 00:00:00 2001 From: Promofaux Date: Fri, 15 Jul 2016 21:11:10 +0100 Subject: [PATCH 6/8] Dan forgot this : `}` --- advanced/Scripts/piholeDebug.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 87a87f88..e22a36aa 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -74,6 +74,7 @@ function distroCheck { TMP=$(cat /etc/*release/ || echo "Failed to find release") echo "Distribution Version: $TMP" >> $DEBUG_LOG +} function compareWhitelist { if [ ! -f "$WHITELISTMATCHES" ]; then From 61ff12e8d42f7a473180c7331ed55c0c2379c7dd Mon Sep 17 00:00:00 2001 From: Promofaux Date: Fri, 15 Jul 2016 21:17:16 +0100 Subject: [PATCH 7/8] Change header to match the rest of the scripts. --- advanced/Scripts/piholeDebug.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index e22a36aa..c5b52daf 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -10,9 +10,6 @@ # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. -# Nate Brandeburg -# nate@ubiquisoft.com -# 3/24/2016 ######## GLOBAL VARS ######## DEBUG_LOG="/var/log/pihole_debug.log" From ce8f07750f04409bbc6354cb46dd604688dfa01b Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Fri, 15 Jul 2016 22:46:21 -0700 Subject: [PATCH 8/8] Remove trailing slash on os-release check Fixes #CLOSED Remove trailing slash that would cause an os-check to always fail out. --- advanced/Scripts/piholeDebug.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index c5b52daf..36ae15bc 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -69,7 +69,7 @@ function distroCheck { echo "######## Distribution Section #########" >> $DEBUG_LOG echo "#######################################" >> $DEBUG_LOG - TMP=$(cat /etc/*release/ || echo "Failed to find release") + TMP=$(cat /etc/*release || echo "Failed to find release") echo "Distribution Version: $TMP" >> $DEBUG_LOG }