From 5347ee48969e9e6306c644d9d9337a052df66215 Mon Sep 17 00:00:00 2001 From: nate Date: Mon, 4 Apr 2016 00:59:24 -0500 Subject: [PATCH 1/2] Write verbose status of processes to debug log & Minor UI Fixes --- advanced/Scripts/piholeDebug.sh | 20 +++++++++++++++++++- automated install/uninstall.sh | 6 +++--- gravity.sh | 14 +++++++------- 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index e9d95234..7a995c99 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -116,6 +116,24 @@ function testNslookup { echo >> $DEBUG_LOG } +function checkProcesses { + echo "#######################################" >> $DEBUG_LOG + echo "########### Processes Check ###########" >> $DEBUG_LOG + echo "#######################################" >> $DEBUG_LOG + echo ":::" + echo "::: Logging status of lighttpd and dnsmasq..." + PROCESSES=( lighttpd dnsmasq ) + for i in "${PROCESSES[@]}" + do + echo "" >> $DEBUG_LOG + echo -n $i >> $DEBUG_LOG + echo " processes status:" >> $DEBUG_LOG + $SUDO systemctl -l status $i >> $DEBUG_LOG + done +} + +### END FUNCTIONS ### + ### Check Pi internet connections ### # Log the IP addresses of this Pi IPADDR=$($SUDO ifconfig | perl -nle 's/dr:(\S+)/print $1/e') @@ -130,10 +148,10 @@ echo "Gateway check:" >> $DEBUG_LOG echo "$GATEWAY_CHECK" >> $DEBUG_LOG echo >> $DEBUG_LOG -# Test the nslookup here compareWhitelist compareBlacklist testNslookup +checkProcesses echo "::: Writing dnsmasq.conf to debug log..." echo "#######################################" >> $DEBUG_LOG diff --git a/automated install/uninstall.sh b/automated install/uninstall.sh index 7082713a..484a544d 100755 --- a/automated install/uninstall.sh +++ b/automated install/uninstall.sh @@ -51,8 +51,8 @@ echo ":::" read -rp "::: Do you wish to remove $i from your system? [y/n]: " yn case $yn in [Yy]* ) printf ":::\tRemoving %s..." "$i"; $SUDO apt-get -y remove --purge "$i" &> /dev/null & spinner $!; printf "done!\n"; break;; - [Nn]* ) printf ":::\tSkipping %s" "$i"; break;; - * ) printf "::: You must answer yes or no!";; + [Nn]* ) printf ":::\tSkipping %s" "$i\n"; break;; + * ) printf "::: You must answer yes or no!\n";; esac done else @@ -127,7 +127,7 @@ function removeNoPurge { echo ":::" printf "::: Finished removing PiHole from your system. Sorry to see you go!\n" printf "::: Reach out to us at https://github.com/pi-hole/pi-hole/issues if you need help\n" - printf "::: Reinstall by simpling running\n:::\n:::\tcurl -L install.pi-hole.net | bash\n:::\n::: at any time!\n:::\n" + printf "::: Reinstall by simpling running\n:::\n:::\tcurl -L https://install.pi-hole.net | bash\n:::\n::: at any time!\n:::\n" printf "::: PLEASE RESET YOUR DNS ON YOUR ROUTER/CLIENTS TO RESTORE INTERNET CONNECTIVITY!\n" } diff --git a/gravity.sh b/gravity.sh index c8a0d842..d741ac80 100755 --- a/gravity.sh +++ b/gravity.sh @@ -124,13 +124,13 @@ function gravity_collapse() { # Temporary hack to allow non-root access to pihole directory # Will update later, needed for existing installs, new installs should # create this directory as non-root - find "$piholeDir" -type f -exec $SUDO chmod 666 {} \; & spinner $! - echo ":::" - else - echo -n "::: Creating pihole directory..." - mkdir $piholeDir & spinner $! $SUDO chmod 777 $piholeDir - echo " done!" + echo ":::" + echo "::: Existing pihole directory found" + else + echo "::: Creating pihole directory..." + mkdir $piholeDir + $SUDO chmod 777 $piholeDir fi } @@ -174,7 +174,7 @@ function gravity_transport() { # spinup - main gravity function function gravity_spinup() { - echo "::: " + echo ":::" # Loop through domain list. Download each one and remove commented lines (lines beginning with '# 'or '/') and # blank lines for ((i = 0; i < "${#sources[@]}"; i++)) do From 7e06769d4427640ebca0af98b216b474a19c9aad Mon Sep 17 00:00:00 2001 From: nate Date: Mon, 4 Apr 2016 01:03:05 -0500 Subject: [PATCH 2/2] Double quoting --- advanced/Scripts/piholeDebug.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index 7a995c99..03d1498a 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -126,9 +126,9 @@ function checkProcesses { for i in "${PROCESSES[@]}" do echo "" >> $DEBUG_LOG - echo -n $i >> $DEBUG_LOG + echo -n $i >> "$DEBUG_LOG" echo " processes status:" >> $DEBUG_LOG - $SUDO systemctl -l status $i >> $DEBUG_LOG + $SUDO systemctl -l status $i >> "$DEBUG_LOG" done }