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

Merge pull request #427 from pi-hole/SystemctlDebugLogging

Write verbose status of processes to debug log & Minor UI Fixes
This commit is contained in:
Adam Warner 2016-04-04 14:59:22 +01:00
commit 7efb17537a
3 changed files with 29 additions and 11 deletions

View File

@ -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

View File

@ -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"
}

View File

@ -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