1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-02-12 08:02:36 +00:00

Skip some checks in docker container

These commands always fail in containers with "command not found" (as expected).

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign 2025-01-09 18:06:06 -03:00
parent 733dce1c4c
commit 0590bbba2d
No known key found for this signature in database
GPG Key ID: AE3C7FC910687F33

View File

@ -492,13 +492,25 @@ run_and_print_command() {
}
hardware_check() {
# Note: the checks are skipped if Pi-hole is running in a docker container
local skip_msg="${INFO} Not enough permissions inside Docker container ${COL_YELLOW}(skipped)${COL_NC}"
echo_current_diagnostic "System hardware configuration"
# Store the output of the command in a variable
run_and_print_command "lshw -short"
if [ -n "${DOCKER_VERSION}" ]; then
log_write "${skip_msg}"
else
# Store the output of the command in a variable
run_and_print_command "lshw -short"
fi
echo_current_diagnostic "Processor details"
# Store the output of the command in a variable
run_and_print_command "lscpu"
if [ -n "${DOCKER_VERSION}" ]; then
log_write "${skip_msg}"
else
# Store the output of the command in a variable
run_and_print_command "lscpu"
fi
}
disk_usage() {