mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Start to refine tests and clean up code.
This commit is contained in:
parent
d9a16b0ff4
commit
9cd830b6aa
1 changed files with 5 additions and 13 deletions
|
@ -68,10 +68,6 @@ log_echo() {
|
||||||
echo "${2}"
|
echo "${2}"
|
||||||
log_write "${2}"
|
log_write "${2}"
|
||||||
;;
|
;;
|
||||||
-e)
|
|
||||||
echo "${2}"
|
|
||||||
log_write
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "::: ${1}"
|
echo "::: ${1}"
|
||||||
log_write "${1}"
|
log_write "${1}"
|
||||||
|
@ -87,7 +83,7 @@ header_write() {
|
||||||
file_parse() {
|
file_parse() {
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
if [ ! -z "${line}" ]; then
|
if [ ! -z "${line}" ]; then
|
||||||
[[ "${line}" =~ ^#.*$ ]] && continue
|
[[ "${line}" =~ ^#.*$ || ! "${line}" ]] && continue
|
||||||
log_write "${line}"
|
log_write "${line}"
|
||||||
fi
|
fi
|
||||||
done < "${1}"
|
done < "${1}"
|
||||||
|
@ -101,15 +97,13 @@ block_parse() {
|
||||||
lsof_parse() {
|
lsof_parse() {
|
||||||
local user
|
local user
|
||||||
local process
|
local process
|
||||||
local match
|
|
||||||
|
|
||||||
user=$(echo ${1} | cut -f 3 -d ' ' | cut -c 2-)
|
user=$(echo ${1} | cut -f 3 -d ' ' | cut -c 2-)
|
||||||
process=$(echo ${1} | cut -f 2 -d ' ' | cut -c 2-)
|
process=$(echo ${1} | cut -f 2 -d ' ' | cut -c 2-)
|
||||||
if [[ ${2} -eq ${process} ]]; then
|
[[ ${2} -eq ${process} ]] \
|
||||||
echo "::: Correctly configured."
|
&& echo "::: Correctly configured." \
|
||||||
else
|
|| log_echo "::: Failure: Incorrectly configured daemon."
|
||||||
log_echo "::: Failure: Incorrectly configured daemon."
|
|
||||||
fi
|
|
||||||
log_write "Found user ${user} with process ${process}"
|
log_write "Found user ${user} with process ${process}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -333,8 +327,6 @@ distro_check || echo "Distro Check soft fail"
|
||||||
processor_check || echo "Processor Check soft fail"
|
processor_check || echo "Processor Check soft fail"
|
||||||
|
|
||||||
ip_check
|
ip_check
|
||||||
#hostnameCheck
|
|
||||||
|
|
||||||
|
|
||||||
daemon_check lighttpd http
|
daemon_check lighttpd http
|
||||||
daemon_check dnsmasq domain
|
daemon_check dnsmasq domain
|
||||||
|
|
Loading…
Reference in a new issue