mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-01-11 22:44:44 +00:00
Clear up bottom half of script with fewer redundenicies.
This commit is contained in:
parent
cb5c94ef5e
commit
d9a16b0ff4
1 changed files with 5 additions and 61 deletions
|
@ -295,10 +295,6 @@ testResolver() {
|
||||||
log_write "Pi-hole dnsmasq specific records lookups"
|
log_write "Pi-hole dnsmasq specific records lookups"
|
||||||
log_write "Cache Size:"
|
log_write "Cache Size:"
|
||||||
dig +short chaos txt cachesize.bind >> ${DEBUG_LOG}
|
dig +short chaos txt cachesize.bind >> ${DEBUG_LOG}
|
||||||
log_write "Misses count:"
|
|
||||||
dig +short chaos txt misses.bind >> ${DEBUG_LOG}
|
|
||||||
log_write "Hits count:"
|
|
||||||
dig +short chaos txt hits.bind >> ${DEBUG_LOG}
|
|
||||||
log_write "Upstream Servers:"
|
log_write "Upstream Servers:"
|
||||||
dig +short chaos txt servers.bind >> ${DEBUG_LOG}
|
dig +short chaos txt servers.bind >> ${DEBUG_LOG}
|
||||||
log_write ""
|
log_write ""
|
||||||
|
@ -346,25 +342,11 @@ checkProcesses
|
||||||
testResolver
|
testResolver
|
||||||
debugLighttpd
|
debugLighttpd
|
||||||
|
|
||||||
header_write "Dnsmasq configuration"
|
files_check "${DNSMASQFILE}"
|
||||||
files_check ${DNSMASQFILE}
|
files_check "${DNSMASQCONFFILE}"
|
||||||
|
files_check "${WHITELISTFILE}"
|
||||||
|
files_check "${BLACKLISTFILE}"
|
||||||
echo "::: Writing 01-pihole.conf to debug log..."
|
files_check "${ADLISTFILE}"
|
||||||
header_write "01-pihole.conf"
|
|
||||||
|
|
||||||
if [ -e "${DNSMASQCONFFILE}" ]; then
|
|
||||||
while read -r line; do
|
|
||||||
if [ ! -z "${line}" ]; then
|
|
||||||
[[ "${line}" =~ ^#.*$ ]] && continue
|
|
||||||
log_write "${line}"
|
|
||||||
fi
|
|
||||||
done < "${DNSMASQCONFFILE}"
|
|
||||||
log_write
|
|
||||||
else
|
|
||||||
log_write "No 01-pihole.conf file found!"
|
|
||||||
printf ":::\tNo 01-pihole.conf file found\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
header_write "Analyzing gravity.list"
|
header_write "Analyzing gravity.list"
|
||||||
|
@ -373,44 +355,6 @@ header_write "Analyzing gravity.list"
|
||||||
&& log_write "${GRAVITYFILE} is ${gravity_length} lines long." \
|
&& log_write "${GRAVITYFILE} is ${gravity_length} lines long." \
|
||||||
|| log_echo "Warning: No gravity.list file found!"
|
|| log_echo "Warning: No gravity.list file found!"
|
||||||
|
|
||||||
|
|
||||||
### Pi-hole application specific logging ###
|
|
||||||
echo "::: Writing whitelist to debug log..."
|
|
||||||
header_write "Whitelist"
|
|
||||||
if [ -e "${WHITELISTFILE}" ]; then
|
|
||||||
cat "${WHITELISTFILE}" >> ${DEBUG_LOG}
|
|
||||||
log_write
|
|
||||||
else
|
|
||||||
log_write "No whitelist.txt file found!"
|
|
||||||
printf ":::\tNo whitelist.txt file found!\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "::: Writing blacklist to debug log..."
|
|
||||||
header_write "Blacklist"
|
|
||||||
if [ -e "${BLACKLISTFILE}" ]; then
|
|
||||||
cat "${BLACKLISTFILE}" >> ${DEBUG_LOG}
|
|
||||||
log_write
|
|
||||||
else
|
|
||||||
log_write "No blacklist.txt file found!"
|
|
||||||
printf ":::\tNo blacklist.txt file found!\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "::: Writing adlists.list to debug log..."
|
|
||||||
header_write "adlists.list"
|
|
||||||
if [ -e "${ADLISTFILE}" ]; then
|
|
||||||
while read -r line; do
|
|
||||||
if [ ! -z "${line}" ]; then
|
|
||||||
[[ "${line}" =~ ^#.*$ ]] && continue
|
|
||||||
log_write "${line}"
|
|
||||||
fi
|
|
||||||
done < "${ADLISTFILE}"
|
|
||||||
log_write
|
|
||||||
else
|
|
||||||
log_write "No adlists.list file found... using adlists.default!"
|
|
||||||
printf ":::\tNo adlists.list file found... using adlists.default!\n"
|
|
||||||
fi
|
|
||||||
echo
|
|
||||||
|
|
||||||
# Continuously append the pihole.log file to the pihole_debug.log file
|
# Continuously append the pihole.log file to the pihole_debug.log file
|
||||||
dumpPiHoleLog() {
|
dumpPiHoleLog() {
|
||||||
trap '{ echo -e "\n::: Finishing debug write from interrupt... Quitting!" ; exit 1; }' INT
|
trap '{ echo -e "\n::: Finishing debug write from interrupt... Quitting!" ; exit 1; }' INT
|
||||||
|
|
Loading…
Reference in a new issue