mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 06:10:20 +00:00
Write verbose status of processes to debug log & Minor UI Fixes
This commit is contained in:
parent
3e6dd9ea9e
commit
5347ee4896
3 changed files with 29 additions and 11 deletions
|
@ -116,6 +116,24 @@ function testNslookup {
|
||||||
echo >> $DEBUG_LOG
|
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 ###
|
### Check Pi internet connections ###
|
||||||
# Log the IP addresses of this Pi
|
# Log the IP addresses of this Pi
|
||||||
IPADDR=$($SUDO ifconfig | perl -nle 's/dr:(\S+)/print $1/e')
|
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 "$GATEWAY_CHECK" >> $DEBUG_LOG
|
||||||
echo >> $DEBUG_LOG
|
echo >> $DEBUG_LOG
|
||||||
|
|
||||||
# Test the nslookup here
|
|
||||||
compareWhitelist
|
compareWhitelist
|
||||||
compareBlacklist
|
compareBlacklist
|
||||||
testNslookup
|
testNslookup
|
||||||
|
checkProcesses
|
||||||
|
|
||||||
echo "::: Writing dnsmasq.conf to debug log..."
|
echo "::: Writing dnsmasq.conf to debug log..."
|
||||||
echo "#######################################" >> $DEBUG_LOG
|
echo "#######################################" >> $DEBUG_LOG
|
||||||
|
|
|
@ -51,8 +51,8 @@ echo ":::"
|
||||||
read -rp "::: Do you wish to remove $i from your system? [y/n]: " yn
|
read -rp "::: Do you wish to remove $i from your system? [y/n]: " yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) printf ":::\tRemoving %s..." "$i"; $SUDO apt-get -y remove --purge "$i" &> /dev/null & spinner $!; printf "done!\n"; break;;
|
[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;;
|
[Nn]* ) printf ":::\tSkipping %s" "$i\n"; break;;
|
||||||
* ) printf "::: You must answer yes or no!";;
|
* ) printf "::: You must answer yes or no!\n";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
@ -127,7 +127,7 @@ function removeNoPurge {
|
||||||
echo ":::"
|
echo ":::"
|
||||||
printf "::: Finished removing PiHole from your system. Sorry to see you go!\n"
|
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 "::: 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"
|
printf "::: PLEASE RESET YOUR DNS ON YOUR ROUTER/CLIENTS TO RESTORE INTERNET CONNECTIVITY!\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
14
gravity.sh
14
gravity.sh
|
@ -124,13 +124,13 @@ function gravity_collapse() {
|
||||||
# Temporary hack to allow non-root access to pihole directory
|
# Temporary hack to allow non-root access to pihole directory
|
||||||
# Will update later, needed for existing installs, new installs should
|
# Will update later, needed for existing installs, new installs should
|
||||||
# create this directory as non-root
|
# 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
|
$SUDO chmod 777 $piholeDir
|
||||||
echo " done!"
|
echo ":::"
|
||||||
|
echo "::: Existing pihole directory found"
|
||||||
|
else
|
||||||
|
echo "::: Creating pihole directory..."
|
||||||
|
mkdir $piholeDir
|
||||||
|
$SUDO chmod 777 $piholeDir
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ function gravity_transport() {
|
||||||
|
|
||||||
# spinup - main gravity function
|
# spinup - main gravity function
|
||||||
function gravity_spinup() {
|
function gravity_spinup() {
|
||||||
echo "::: "
|
echo ":::"
|
||||||
# Loop through domain list. Download each one and remove commented lines (lines beginning with '# 'or '/') and # blank lines
|
# Loop through domain list. Download each one and remove commented lines (lines beginning with '# 'or '/') and # blank lines
|
||||||
for ((i = 0; i < "${#sources[@]}"; i++))
|
for ((i = 0; i < "${#sources[@]}"; i++))
|
||||||
do
|
do
|
||||||
|
|
Loading…
Reference in a new issue