mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-09 07:30:56 +00:00
Generalize CPU check to a short hardware information output
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
dcc7e96d2f
commit
c86e7b3f96
@ -482,34 +482,34 @@ check_firewalld() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
processor_check() {
|
run_and_print_command() {
|
||||||
echo_current_diagnostic "Processor"
|
# Run the command passed as an argument
|
||||||
# Store the processor type in a variable
|
local cmd="${1}"
|
||||||
PROCESSOR=$(uname -m)
|
# Show the command that is being run
|
||||||
# If it does not contain a value,
|
log_write "${INFO} ${cmd}"
|
||||||
if [[ -z "${PROCESSOR}" ]]; then
|
# Run the command and store the output in a variable
|
||||||
# we couldn't detect it, so show an error
|
local output
|
||||||
PROCESSOR=$(lscpu | awk '/Architecture/ {print $2}')
|
output=$(${cmd} 2>&1)
|
||||||
log_write "${CROSS} ${COL_RED}${PROCESSOR}${COL_NC} has not been tested with FTL, but may still work: (${FAQ_FTL_COMPATIBILITY})"
|
# If the command was successful,
|
||||||
|
if [[ $? -eq 0 ]]; then
|
||||||
|
# show the output
|
||||||
|
log_write "${output}"
|
||||||
else
|
else
|
||||||
# Check if the architecture is currently supported for FTL
|
# otherwise, show an error
|
||||||
case "${PROCESSOR}" in
|
log_write "${CROSS} ${COL_RED}Command failed${COL_NC}"
|
||||||
"amd64" | "x86_64") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
|
|
||||||
;;
|
|
||||||
"armv6l") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
|
|
||||||
;;
|
|
||||||
"armv6") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
|
|
||||||
;;
|
|
||||||
"armv7l") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
|
|
||||||
;;
|
|
||||||
"aarch64") log_write "${TICK} ${COL_GREEN}${PROCESSOR}${COL_NC}"
|
|
||||||
;;
|
|
||||||
# Otherwise, show the processor type
|
|
||||||
*) log_write "${INFO} ${PROCESSOR}";
|
|
||||||
esac
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hardware_check() {
|
||||||
|
echo_current_diagnostic "System hardware configuration"
|
||||||
|
# Store the output of the command in a variable
|
||||||
|
run_and_print_command "lshw -short"
|
||||||
|
|
||||||
|
echo_current_diagnostic "Processor details"
|
||||||
|
# Store the output of the command in a variable
|
||||||
|
run_and_print_command "lscpu"
|
||||||
|
}
|
||||||
|
|
||||||
disk_usage() {
|
disk_usage() {
|
||||||
local file_system
|
local file_system
|
||||||
local hide
|
local hide
|
||||||
@ -1403,7 +1403,7 @@ check_component_versions
|
|||||||
diagnose_operating_system
|
diagnose_operating_system
|
||||||
check_selinux
|
check_selinux
|
||||||
check_firewalld
|
check_firewalld
|
||||||
processor_check
|
hardware_check
|
||||||
disk_usage
|
disk_usage
|
||||||
check_ip_command
|
check_ip_command
|
||||||
check_networking
|
check_networking
|
||||||
|
Loading…
Reference in New Issue
Block a user